Suyeon Jung

Add route setting

......@@ -6,7 +6,7 @@ var logger = require('morgan');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var selectRouter = require('./routes/select')
var selectRouter = require('./routes/select');
var app = express();
var bodyParser = require('body-parser');
// view engine setup
......@@ -20,7 +20,7 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, '/static'))); //정적파일 위치
app.use('/', indexRouter);
app.use('/users', usersRouter);
app.use('/select', selectRouter)
app.use('/select', selectRouter);
app.use(bodyParser.urlencoded({ extended: false }));
// catch 404 and forward to error handler
......
......@@ -4,6 +4,8 @@ var request = require('request');
require('dotenv').config();
/* GET home page. */
let SIGUN_CODE;
let SIGUNDONG_CODE;
// 사용자가 index 페이지에서 주소를 입력하고 넘어오면
router.post('/', function(req, res) {
......@@ -38,4 +40,24 @@ router.post('/', function(req, res) {
res.render('select', { 'userLocation': req.body.userLocation });
});
router.get('/food', function(req, res) {
res.send('This is food');
});
router.get('/school', function(req, res) {
res.send('This is school');
});
router.get('/park', function(req, res) {
res.send('This is park');
});
router.get('/transport', function(req, res) {
res.send('This is transport');
});
router.get('/safe', function(req, res) {
res.send('This is safe');
});
router.get('/culture', function(req, res) {
res.send('This is culture');
});
module.exports = router;
\ No newline at end of file
......
......@@ -11,12 +11,12 @@ html
.card(style='background-color: skyblue; display: inline-block;')
.card-image
img(src='/restaurant.jpg' style='width:400px; height: 300px;')
h1.card-title 음식
h1.card-title 맛집
.card-content
p
| 주변 동네 맛집의 개수와 얼마나 다양한 음식점이 있는지
.card-action
a(href='#') 검사!
a(href='/select/food') 검사!
.card(style='background-color: skyblue; display: inline-block;')
.card-image
......@@ -26,7 +26,7 @@ html
p
| 주변 학교, 학원 환경
.card-action
a(href='#') 검사!
a(href='/select/school') 검사!
.card(style='background-color: skyblue; display: inline-block;')
.card-image
......@@ -36,7 +36,7 @@ html
p
| 주변 공원
.card-action
a(href='#') 검사!
a(href='/select/park') 검사!
.card(style='background-color: skyblue; display: inline-block;')
.card-image
......@@ -46,7 +46,7 @@ html
p
| 대중교통 편리도
.card-action
a(href='#') 검사!
a(href='/select/transport') 검사!
.card(style='background-color: skyblue; display: inline-block;')
.card-image
......@@ -56,7 +56,7 @@ html
p
| 주변 경찰서, 범죄자 인근~~
.card-action
a(href='#') 검사!
a(href='/select/safe') 검사!
.card(style='background-color: skyblue; display: inline-block;')
.card-image
......@@ -66,5 +66,5 @@ html
p
| 문화생활 시설
.card-action
a(href='#') 검사!
a(href='/select/culture') 검사!
......