Added logging config.

This commit is contained in:
Andrew Lalis 2023-04-02 12:33:05 +02:00
parent e0edfb8d68
commit b347cd609e
3 changed files with 9 additions and 0 deletions

View File

@ -14,3 +14,5 @@ gymboard-uploads-test-*
*.o
*.obj
*.lst
temp-uploads/

View File

@ -1,10 +1,16 @@
import std.stdio;
import handy_httpd;
import handy_httpd.handlers.path_delegating_handler;
import slf4d;
import slf4d.default_provider;
import handlers;
void main() {
// Configure logging
auto provider = new shared DefaultProvider(true, Levels.TRACE);
configureLoggingProvider(provider);
PathDelegatingHandler pathHandler = new PathDelegatingHandler();
pathHandler.addMapping("GET", "/status", (ref HttpRequestContext ctx) {
ctx.response.writeBodyString("online");

View File

@ -1,6 +1,7 @@
module handlers;
import handy_httpd;
import handy_httpd.util.range;
import slf4d;
import std.conv : to;
import std.path;