uselesshttp.d/main.d

23 lines
512 B
D

module app; // обязательно
import lib, util: Location;
void main() {
auto srv = Server("127.0.0.1", 3003);
srv.start!app;
// srv.shutdown;
}
@Location("/skunk")
void huy(Response* w, Request* r) {
w.body = cast(ubyte[])"skunk";
return;
}
@Location("/skunks")
void z(Response* w, Request* r) {
w.headers["X-Powered-By"] = "D";
w.headers["Lang"] = "D";
w.status = 410;
w.mimetype = "text/plain;charset=utf-8";
w.body = cast(ubyte[])"скунсы";
return;
}