-
Notifications
You must be signed in to change notification settings - Fork 0
/
app_kim.js
54 lines (49 loc) · 1.34 KB
/
app_kim.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
50
51
52
53
54
const express = require('express');
const fs = require('fs');
const bodyParser = require('body-parser');
const mysql = require('mysql');
const app = express();
const conn = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'dhwjs4248',
port: '3307',
database: ''
});
conn.connect();
app.use(bodyParser.urlencoded({extended: false}));
app.set('view engine', 'jade');
app.set('views', './views_kim');
app.locals.pretty = true;
app.use(express.static('views_kim')); // 이미지 상위 폴더 지정
app.listen(3000, ()=>{
console.log('Connected 3000 port');
});
app.get('/', (req, res)=>{
res.render('view.jade');
});
app.get('/about', (req, res)=>{
res.render('about.jade');
});
app.get('/signin', (req, res)=>{
res.render('signin.jade');
});
app.get('/w_all', (req, res)=>{
res.render('w_all.jade');
});
app.get('/w_outer', (req,res)=>{
res.render('w_outer.jade');
});
app.get('/w_top', (req,res)=>{
res.render('w_top.jade');
});
app.get('/w_bottom', (req,res)=>{
res.render('w_bottom.jade');
});
app.get('/w_outer/item01', (req,res)=>{
res.render('item01.jade')
});
// 일단 db랑 연동하는거 안배웠으니까, 여기까지. 연동 후 회원가입, 로그인 구현
app.post('/signin', (req,res)=>{
res.redirect('/signin');
})