archttp 0.0.1

A highly performant web framework written in D.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Archttp

A highly performant web framework written in D.

Example for web server


import archttp;

void main()
{
    auto app = new Archttp;

    app.Bind(8080);

    app.Get("/", (context) {
        auto response = context.response();
        response.body("Hello Archttp");
    });

    app.Get("/json", (context) {
        import std.json;

        auto response = context.response();
        auto j = JSONValue( ["message" : "Hello, World!"] );
        
        response.json(j);
    });

    app.Get("/user/{id:\\d+}", (context) {
        auto request = context.request();
        auto response = context.response();
        response.body("User id: " ~ request.parameters["id"]);
    });

    app.Get("/blog/{name}", (context) {
        auto request = context.request();
        auto response = context.response();
        response.body("Username: " ~ request.parameters["name"]);
    });

    app.Post("/upload", (context) {
        auto response = context.response();
        response.body("Using post method!");
    });

    app.Run();
}

Dependencies

Thanks contributors

  • zoujiaqing
  • Heromyth
  • ikod
  • tchaloupka
  • dhasenan
Dependencies:
geario
Versions:
1.1.1 2022-May-31
1.1.0 2022-May-27
1.0.2 2022-May-27
1.0.1 2022-May-24
1.0.0 2022-May-20
Show all 9 versions
Download Stats:
  • 8 downloads today

  • 14 downloads this week

  • 28 downloads this month

  • 1715 downloads total

Score:
1.5
Short URL:
archttp.dub.pm