add middleware handler, move notfound to own func

This commit is contained in:
2023-05-11 12:16:13 +02:00
parent ab10ab7091
commit a9017c7550
2 changed files with 62 additions and 65 deletions

View File

@@ -3,6 +3,10 @@ import { HTTPServer } from "../mod.ts";
const httpServer = new HTTPServer();
httpServer.middleware((req) => {
console.log(`User Requested ${req.path}`);
})
httpServer.error((req, _rep) => {
return JSON.stringify(
{