-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
31 lines (25 loc) · 828 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import express from "express";
import * as dotenv from "dotenv";
import { initializeDatabase } from "./src/config";
import { identityRouter } from "./src/v1/routes";
import { userRouter } from "./src/v1/routes";
import { messageRouter } from "./src/v1/routes";
import { swaggerDocs as swaggerDocsV1 } from "./src/v1/swagger";
const bootstrap = async () => {
const app = express();
dotenv.config();
app.use(express.json());
app.use("/api/v1", userRouter);
app.use("/api/v1", identityRouter);
app.use("/api/v1", messageRouter);
app.get("/check-health", async (req, res) => {
const message = "Api Up!";
res.status(200).json({ message });
});
await initializeDatabase();
app.listen(process.env.PORT, () => {
swaggerDocsV1(app);
console.log("🚀 API Running:", true);
});
};
bootstrap();