mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-21 21:09:22 +00:00
Split main function into two functions
This commit is contained in:
parent
26f6c12f35
commit
1198e28696
11
src/main.ts
11
src/main.ts
@ -25,6 +25,14 @@ async function init() {
|
||||
console.info("Connect to database");
|
||||
await DatabaseHelper.connect();
|
||||
|
||||
await startServer();
|
||||
}
|
||||
init();
|
||||
|
||||
/**
|
||||
* Run the server
|
||||
*/
|
||||
async function startServer() {
|
||||
// Start HTTP Server
|
||||
const app = expressWs(express()).app;
|
||||
|
||||
@ -101,5 +109,4 @@ async function init() {
|
||||
app.listen(conf().port, () => {
|
||||
console.info("Started server on http://127.0.0.1:" + conf().port);
|
||||
});
|
||||
}
|
||||
init();
|
||||
}
|
Loading…
Reference in New Issue
Block a user