forked from OssPipeline/REGO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
39 lines (31 loc) · 939 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
const express = require("express");
const app = express();
const bodyParser = require("body-parser");
const session = require("express-session");
const ejs = require("ejs");
const multer = require("multer");
const port = 5000;
app.set("view engine", "ejs");
app.use(
bodyParser.urlencoded({
extended: false,
})
);
app.use(express.json());
app.use('/public', express.static(__dirname + '/public'));
//로그인 후 세션 유지를 위한 코드
app.use(
session({
secret: "my key",
resave: false,
saveUninitialize: true,
})
);
app.use('/public', express.static(__dirname + '/public'));
app.use("/", require("./controllers/main"));
app.use("/signup", require("./controllers/signup"));
app.use("/login", require("./controllers/login"));
app.use("/logout", require("./controllers/logout"));
app.use("/my_goal", require("./controllers/my_goal"));
app.listen(port);
console.log(`app is listening port ${port}`);