-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
44 lines (38 loc) · 979 Bytes
/
app.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
39
40
41
42
43
44
const express = require("express");
const morgan = require("morgan");
const cors = require("cors");
const cookieParser = require("cookie-parser");
const session = require("express-session");
const router = require("./routes");
const dotenv = require("dotenv");
dotenv.config();
const app = express();
app.set("port", process.env.PORT || 3002);
app.use(morgan("dev"));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser(process.env.COOKIE_SECRET));
app.use(
session({
resave: false,
saveUninitialized: false,
secret: process.env.COOKIE_SECRET,
cookie: {
httpOnly: true,
//secure: true,
// sameSite: "none",
},
name: "session-cookie",
})
);
app.use(
cors({
origin: ["https://calming-signal.ml", "https://www.calming-signal.ml"],
method: "GET,POST,OPTION, PATCH",
credentials: true,
})
);
app.use("/", router);
app.listen(80, () => {
console.log("80번 포트");
});