Files
Compo-Service-Log-Project/src/index.ts
T
2024-11-11 23:09:59 +01:00

19 lines
468 B
TypeScript

import dotenv from "dotenv";
import Server from "./Server";
import { DatasetCollection } from "./services/dataset";
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);