From 7b9c66774905ab469bd60761729e57de59b43e05 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 19 Dec 2022 14:03:22 -0500 Subject: [PATCH] *Routes must be defined before listen --- src/modules/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/app.ts b/src/modules/app.ts index 5c5636a..b88814c 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -12,12 +12,12 @@ export async function start() { logger: true, }); - await app.listen({ port: 80, host: "0.0.0.0" }); - app.get("/", (req, res) => { res.send(Buffer.from(keyPair.publicKey).toString("hex")); }); + await app.listen({ port: 80, host: "0.0.0.0" }); + const address = app.server.address() as AddressInfo; log.info("HTTP/App Server started on ", `${address.address}:${address.port}`);