mirror of
https://git.macaw.me/skunky/uselesshttp.d.git
synced 2025-04-28 12:05:08 +03:00
название коммита
This commit is contained in:
parent
8a7c1fd13d
commit
722fa7f63b
5 changed files with 293 additions and 0 deletions
23
main.d
Normal file
23
main.d
Normal file
|
@ -0,0 +1,23 @@
|
|||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue