feat: Launch Server and database async

This commit is contained in:
Lucàs
2024-12-16 18:50:43 +01:00
parent 6975765e18
commit 735ab03d6e
4 changed files with 31 additions and 49 deletions
+2 -7
View File
@@ -5,14 +5,9 @@ import { TypeOrmDataSource } from "./TypeOrmDataSource";
dotenv.config();
// 1. initialize database connexions
// 2. Load all datasets
// 3. Start the server
TypeOrmDataSource.initialize()
.then(() => DatasetCollection.loadAll())
.then(() => console.log("All datasets are loaded"))
.then(() => new Server().start())
.catch(console.error);
new Server().start();