We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e2f27c commit 8d8950dCopy full SHA for 8d8950d
server.js
@@ -0,0 +1,26 @@
1
+const http = require("http");
2
+const express = require("express");
3
+const path = require("path");
4
+
5
+const app = express();
6
7
+const port = 27017; //인스턴스 생성시 만들었던 포트번호 기입
8
9
+app.get("/ping", (req, res) => {
10
+ res.send("pong");
11
+});
12
13
+app.use(express.static(path.join(__dirname, "build")));
14
15
+app.get("/*", (req, res) => {
16
+ res.set({
17
+ "Cache-Control": "no-cache, no-store, must-revalidate",
18
+ Pragma: "no-cache",
19
+ Date: Date.now(),
20
+ });
21
+ res.sendFile(path.join(__dirname, "build", "index.html"));
22
23
24
+http.createServer(app).listen(port, () => {
25
+ console.log(`app listening at ${port}`);
26
0 commit comments