-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.ts
More file actions
24 lines (17 loc) · 711 Bytes
/
index.ts
File metadata and controls
24 lines (17 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import process from "process";
import cors from "cors";
import express from "express";
import { config } from "./config";
import { DatabaseIndexer } from "./databaseindexer";
import { MasterCalAPIController } from "./controllers/mastercalapi.controller";
import { MasterCalMainPageController } from "./controllers/mastercalmainpage.controller";
import { logger } from "./utils/Logger";
process.title = "mastercal";
const app = express();
app.use(cors());
app.use(logger);
app.use("/", MasterCalMainPageController);
app.use("/api", MasterCalAPIController);
DatabaseIndexer.init().then(() => {
app.listen(config.PORT, () => console.log(`Running api on http://${ config.HOST }:${ config.PORT }/`));
});