From 31a785b13e5a653df194710f7dbb1d62e7016f98 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 21 Sep 2022 09:08:30 -0400 Subject: [PATCH] *Need to create express before booting server --- src/modules/app.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/app.ts b/src/modules/app.ts index eef3cc8..7a67192 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -16,6 +16,7 @@ export function setRouter(newRouter: express.Router): void { } export async function start() { + app = express(); server = http.createServer(app); await new Promise((resolve) => { server.listen(80, "0.0.0.0", function () { @@ -27,7 +28,7 @@ export async function start() { resolve(null); }); }); - app = express(); + app.use(function (req, res, next) { router(req, res, next); });