finnow/finnow-api/source/app.d

18 lines
399 B
D

import slf4d;
import handy_httpd;
import handy_httpd.handlers.path_handler;
import model.base;
void main() {
ServerConfig cfg;
cfg.workerPoolSize = 5;
cfg.port = 8080;
PathHandler pathHandler = new PathHandler();
pathHandler.addMapping(Method.GET, "/status", (ref ctx) {
ctx.response.writeBodyString("online");
});
HttpServer server = new HttpServer(pathHandler, cfg);
server.start();
}