Updated dependencies, changed to use PathHandler

This commit is contained in:
Andrew Lalis 2023-12-01 14:28:07 -05:00
parent cefad9a48a
commit 2f8621e237
3 changed files with 8 additions and 7 deletions

View File

@ -4,10 +4,10 @@
], ],
"copyright": "Copyright © 2023, Andrew Lalis", "copyright": "Copyright © 2023, Andrew Lalis",
"dependencies": { "dependencies": {
"handy-httpd": "~>7.7.0", "handy-httpd": "~>7.13.0",
"requests": "~>2.1.1", "requests": "~>2.1.1",
"scheduled": "~>1.2.0", "scheduled": "~>1.2.0",
"slf4d": "~>2.4.2" "slf4d": "~>2.4.3"
}, },
"description": "HTTP server for generating schematic materials lists.", "description": "HTTP server for generating schematic materials lists.",
"license": "proprietary", "license": "proprietary",

View File

@ -4,11 +4,12 @@
"automem": "0.6.9", "automem": "0.6.9",
"cachetools": "0.4.1", "cachetools": "0.4.1",
"cronexp": "0.1.0-beta3", "cronexp": "0.1.0-beta3",
"handy-httpd": "7.7.0", "handy-httpd": "7.13.0",
"httparsed": "1.2.1", "httparsed": "1.2.1",
"path-matcher": "1.1.3",
"requests": "2.1.1", "requests": "2.1.1",
"scheduled": "1.2.0", "scheduled": "1.2.0",
"slf4d": "2.4.2", "slf4d": "2.4.3",
"streams": "3.5.0", "streams": "3.5.0",
"test_allocator": "0.3.4", "test_allocator": "0.3.4",
"unit-threaded": "0.10.8" "unit-threaded": "0.10.8"

View File

@ -1,7 +1,7 @@
module csgs.http; module csgs.http;
import handy_httpd; import handy_httpd;
import handy_httpd.handlers.path_delegating_handler; import handy_httpd.handlers.path_handler;
import handy_httpd.handlers.file_resolving_handler; import handy_httpd.handlers.file_resolving_handler;
import slf4d; import slf4d;
import std.path; import std.path;
@ -14,9 +14,9 @@ void startServer() {
config.connectionQueueSize = 10; config.connectionQueueSize = 10;
config.port = 8100; config.port = 8100;
PathDelegatingHandler handler = new PathDelegatingHandler(); auto handler = new PathHandler();
handler.addMapping(Method.POST, "/extracts", &handleExtract); handler.addMapping(Method.POST, "/extracts", &handleExtract);
handler.addMapping(Method.GET, "/extracts/{extractId}", &getExtract); handler.addMapping(Method.GET, "/extracts/:extractId", &getExtract);
handler.addMapping(Method.POST, "/item-reports", &handleItemReport); handler.addMapping(Method.POST, "/item-reports", &handleItemReport);
handler.addMapping(Method.GET, "/item-reports", &getItemReports); handler.addMapping(Method.GET, "/item-reports", &getItemReports);
handler.addMapping(Method.GET, "/status", (ref HttpRequestContext ctx) { handler.addMapping(Method.GET, "/status", (ref HttpRequestContext ctx) {