Added logging config.
This commit is contained in:
parent
e0edfb8d68
commit
b347cd609e
|
@ -14,3 +14,5 @@ gymboard-uploads-test-*
|
||||||
*.o
|
*.o
|
||||||
*.obj
|
*.obj
|
||||||
*.lst
|
*.lst
|
||||||
|
|
||||||
|
temp-uploads/
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
import std.stdio;
|
import std.stdio;
|
||||||
import handy_httpd;
|
import handy_httpd;
|
||||||
import handy_httpd.handlers.path_delegating_handler;
|
import handy_httpd.handlers.path_delegating_handler;
|
||||||
|
import slf4d;
|
||||||
|
import slf4d.default_provider;
|
||||||
|
|
||||||
import handlers;
|
import handlers;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
// Configure logging
|
||||||
|
auto provider = new shared DefaultProvider(true, Levels.TRACE);
|
||||||
|
configureLoggingProvider(provider);
|
||||||
|
|
||||||
PathDelegatingHandler pathHandler = new PathDelegatingHandler();
|
PathDelegatingHandler pathHandler = new PathDelegatingHandler();
|
||||||
pathHandler.addMapping("GET", "/status", (ref HttpRequestContext ctx) {
|
pathHandler.addMapping("GET", "/status", (ref HttpRequestContext ctx) {
|
||||||
ctx.response.writeBodyString("online");
|
ctx.response.writeBodyString("online");
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
module handlers;
|
module handlers;
|
||||||
|
|
||||||
import handy_httpd;
|
import handy_httpd;
|
||||||
|
import handy_httpd.util.range;
|
||||||
import slf4d;
|
import slf4d;
|
||||||
import std.conv : to;
|
import std.conv : to;
|
||||||
import std.path;
|
import std.path;
|
||||||
|
|
Loading…
Reference in New Issue