지창언

routes update

...@@ -7,6 +7,9 @@ var bodyParser = require('body-parser') ...@@ -7,6 +7,9 @@ var bodyParser = require('body-parser')
7 var expressErrorHandler = require('express-error-handler'); 7 var expressErrorHandler = require('express-error-handler');
8 var indexRouter = require('./routes/index') 8 var indexRouter = require('./routes/index')
9 var loginRouter = require('./routes/login') 9 var loginRouter = require('./routes/login')
10 +var sign_upRouter = require('./routes/sign_up')
11 +var lpgRouter = require('./routes/lpg')
12 +var weatherRouter = require('./routes/weather')
10 var app = express(); 13 var app = express();
11 14
12 // get port 15 // get port
...@@ -25,9 +28,11 @@ app.use(express.static(path.join(__dirname, 'public'))); ...@@ -25,9 +28,11 @@ app.use(express.static(path.join(__dirname, 'public')));
25 28
26 // 29 //
27 app.use('/login',loginRouter); // login page route 30 app.use('/login',loginRouter); // login page route
31 +app.use('/weather',weatherRouter)
32 +app.use('/lpg',lpgRouter)
33 +app.use('/signup',sign_upRouter); // sign up page route
28 app.use('/', indexRouter); // main page route 34 app.use('/', indexRouter); // main page route
29 35
30 -
31 //모든 router 처리가 끝난 후 404 오류 페이지 처리 36 //모든 router 처리가 끝난 후 404 오류 페이지 처리
32 var errorHandler = expressErrorHandler({ 37 var errorHandler = expressErrorHandler({
33 static: { 38 static: {
......
1 var express = require('express') 1 var express = require('express')
2 -var router = express.Router(); 2 +var router = express.Router()
3 3
4 /* 4 /*
5 //라우터 객체 참조 5 //라우터 객체 참조
......
1 +var express = require('express')
2 +var router = express.Router()
3 +
4 +router.get('/',function(req,res){
5 + res.render('lpg.html')
6 +})
7 +
8 +module.exports = router
...\ No newline at end of file ...\ No newline at end of file
1 +var express = require('express')
2 +var router = express.Router()
3 +
4 +router.get('/',function(req,res){
5 + res.render('sign_up.html')
6 +})
7 +
8 +module.exports = router
...\ No newline at end of file ...\ No newline at end of file
1 +var express = require('express')
2 +var router = express.Router()
3 +
4 +router.get('/',function(req,res){
5 + res.render('weather.html')
6 +})
7 +
8 +module.exports = router
...\ No newline at end of file ...\ No newline at end of file
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
81 </div> 81 </div>
82 <div class = "button"> 82 <div class = "button">
83 <span><a href="/login" style = "color: #0A9696;">Log in</a></span> 83 <span><a href="/login" style = "color: #0A9696;">Log in</a></span>
84 - <span><a href="https://www.google.co.kr" style = "color: #0A9696;">Sign up</a></span> 84 + <span><a href="/sign_up" style = "color: #0A9696;">Sign up</a></span>
85 </div> 85 </div>
86 </div> 86 </div>
87 87
...@@ -96,9 +96,9 @@ ...@@ -96,9 +96,9 @@
96 </div> 96 </div>
97 97
98 <div class="icon"> 98 <div class="icon">
99 - <span style="color:white; font-size:20px;"><b>날씨</b></span> 99 + <span style="color:white; font-size:20px;"><a href = "/weather"><b>날씨</b></a></span>
100 - <span style="color:white; font-size:20px;"><b>메뉴</b></span> 100 + <span style="color:white; font-size:20px;"><a href = "/menu"><b>메뉴</b></a></span>
101 - <span style="color:white; font-size:20px;"><b>LPG</b></span> 101 + <span style="color:white; font-size:20px;"><a href = "lpg"><b>LPG</b></a></span>
102 </div> 102 </div>
103 </div> 103 </div>
104 </div> 104 </div>
......