Added status endpoint

This commit is contained in:
Andrew Lalis 2023-07-23 11:40:07 -04:00
parent eebcf0c91a
commit 68248f40ee
1 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,10 @@ void startServer() {
PathDelegatingHandler handler = new PathDelegatingHandler();
handler.addMapping("POST", "/extracts", &handleExtract);
handler.addMapping("GET", "/extracts/{extractId}", &getExtract);
handler.addMapping("GET", "/status", (ref HttpRequestContext ctx) {
ctx.response.setStatus(HttpStatus.OK);
ctx.response.writeBodyString("online");
});
FileResolvingHandler fileHandler = new FileResolvingHandler("site", DirectoryResolutionStrategies.serveIndexFiles);
handler.addMapping("/**", fileHandler);