-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
38 lines (32 loc) · 1.49 KB
/
server.js
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
32
33
34
35
36
37
38
import dotenv from "dotenv";
dotenv.config();
import express from "express";
import accountRoute from "./src/modules/account/routes/accountRoute.js";
import subscriptionRoute from "./src/modules/subscription/routes/subscriptionRoute.js";
import reportRoute from "./src/modules/report/routes/reportRoute.js";
import noticeRoute from "./src/modules/notice/routes/noticeRoute.js";
import diaryRoute from "./src/modules/diary/routes/diaryRoute.js";
import commentRoute from "./src/modules/comment/routes/commentRoute.js";
import authRoute from "./src/modules/auth/routes/authRoute.js";
import uncaughtExceptionLogger from "./src/shared/logger/uncaughtExceptionLogger.js";
import errorHandler from "./src/shared/middlewares/errorHandler.js";
import grassRoute from "./src/modules/grass/routes/grassRoute.js.js";
import exceptionHandler from "./src/shared/middlewares/exceptionHandler.js";
import interceptor from "./src/shared/middlewares/interceptor.js";
const server = express();
server.use(express.json());
server.use(interceptor);
server.use("/account", accountRoute);
server.use("/auth", authRoute);
server.use("/comment", commentRoute);
server.use("/diary", diaryRoute);
server.use("/grass", grassRoute);
server.use("/notice", noticeRoute);
server.use("/report", reportRoute);
server.use("/subscription", subscriptionRoute);
server.use("/", exceptionHandler);
server.use(errorHandler);
server.listen(80, () => {
console.log(`80번 포트로 실행 중`);
});
process.on("uncaughtException", uncaughtExceptionLogger);