Cleaner server start function

This commit is contained in:
Jonathan Barrow 2023-04-23 19:55:54 -04:00
parent 37d14b16d5
commit 72285ee221
No known key found for this signature in database
GPG Key ID: E86E9FE9049C741F

View File

@ -69,10 +69,16 @@ app.use((error: any, _request: express.Request, response: express.Response, _nex
}));
});
// Starts the server
LOG_INFO('Starting server');
connectDatabase().then(() => {
async function main(): Promise<void> {
// Starts the server
LOG_INFO('Starting server');
await connectDatabase();
// TODO - Connect to account DB here too?
app.listen(port, () => {
LOG_SUCCESS(`Server started on port ${port}`);
});
});
}
main().catch(console.error);