Archttp —— D 语言轻量级 HTTP 框架
Archttp 是一个轻量级易于使用的 http 框架,性能可比肩基于 Golang 开发的 Fasthttp 框架。 示例代码: 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(); au...
