mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-07-12 08:14:14 -05:00
Cleaner server start function
This commit is contained in:
parent
37d14b16d5
commit
72285ee221
|
|
@ -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);
|
||||
Loading…
Reference in New Issue
Block a user