-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
26 lines (21 loc) · 741 Bytes
/
app.js
File metadata and controls
26 lines (21 loc) · 741 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
25
26
const express = require("express");
const http = require("http");
const ws = require("ws");
const app = express();
const server = http.createServer(app);
const wss = new ws.Server({ server });
const stageRouter = require("./src/routes/stageRouter");
const socketRouter = require("./src/routes/socketRouter");
const healthChecker = require("./src/routes/healthChecker");
const historyLogger = require("./src/routes/historyLogger");
const clientCountRouter = require("./src/routes/userCounter");
app.use(express.json());
app.use(stageRouter);
app.use(healthChecker);
app.use(clientCountRouter);
app.use(historyLogger);
socketRouter(wss);
const PORT = 8080;
server.listen(PORT, () => {
console.log(`서버 실행 Port : ${PORT}`);
});