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
- Registered by zoujiaqing
- 0.0.1 released 2 years ago
- kerisy/archttp
- www.kerisy.com
- Apache-2.0
- 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 - Download Stats:
-
-
0 downloads today
-
1 downloads this week
-
15 downloads this month
-
1878 downloads total
-
- Score:
- 1.6
- Short URL:
- archttp.dub.pm