archttp 0.1.0

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.Get("/", (request, response) {
        response.send("Hello, World!");
    });

    app.Get("/json", (request, response) {
        import std.json;
        response.send( JSONValue( ["message" : "Hello, World!"] ) );
    });

    app.Get("/user/{id:\\d+}", (request, response) {
        response.send("User id: " ~ request.params["id"]);
    });

    app.Get("/blog/{name}", (request, response) {
        response.send("Username: " ~ request.params["name"]);
    });

    app.Get("/upload", (request, response) {
        response.send("Using post method!");
    });

    app.Listen(8080);
}

Note on naming rules:

The method names of Archttp classe are all humped with a capital letter, because "get" and "delete" are reserved keywords for D. All other classes have camel - case names that begin with a lowercase letter.

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:
  • 0 downloads today

  • 1 downloads this week

  • 15 downloads this month

  • 1878 downloads total

Score:
1.6
Short URL:
archttp.dub.pm