forked from Jihana030/Hogwarts_School
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
49 lines (34 loc) ยท 1.42 KB
/
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
45
46
47
48
49
const path = require('path');
const express = require('express');
const nunjucks = require('nunjucks');
const bodyParser = require('body-parser');
const { parentPort } = require('worker_threads');
const app = express();
const port = 3001;
app.use(bodyParser.urlencoded({ extended: true }));
const loginRouter = require('./routes/login');
app.use('/hogwarts/main', loginRouter);
const joinRouter = require('./routes/join');
app.use('/hogwarts/join', joinRouter);
const mypageRouter = require('./routes/mypage');
app.use('/hogwarts/mypage', mypageRouter);
const logoutRouter = require('./routes/logout');
app.use('/hogwarts/logout', logoutRouter);
const houseTestRouter = require('./routes/houseTest');
app.use('/hogwarts/houseTest', houseTestRouter);
const alohomoraRouter = require('./routes/alohomora');
app.use('/hogwarts/alohomora', alohomoraRouter);
const houseRouter = require('./routes/house');
app.use('/hogwarts/house', houseRouter);
const historyRouter = require('./routes/history');
app.use('/hogwarts/history', historyRouter);
const professorRouter = require('./routes/professor');
app.use('/hogwarts/professor', professorRouter);
const cookieParser = require('cookie-parser');
app.use(cookieParser());
app.use('/static', express.static(__dirname + '/static'));
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.listen(port, () => {
console.log(`์๋ฒ ์คํ ํฌํธ๋ฒํธ ${port}`);
});