*Routes must be defined before listen

This commit is contained in:
Derrick Hammer 2022-12-19 14:03:22 -05:00
parent d2acea6781
commit 7b9c667749
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -12,12 +12,12 @@ export async function start() {
logger: true, logger: true,
}); });
await app.listen({ port: 80, host: "0.0.0.0" });
app.get("/", (req, res) => { app.get("/", (req, res) => {
res.send(Buffer.from(keyPair.publicKey).toString("hex")); 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; const address = app.server.address() as AddressInfo;
log.info("HTTP/App Server started on ", `${address.address}:${address.port}`); log.info("HTTP/App Server started on ", `${address.address}:${address.port}`);