Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zuzitsu
/
UR_Village
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Suyeon Jung
2020-12-01 20:58:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4a52190c9dde0791882cb6da5fd05fa038bbe981
4a52190c
1 parent
fd0f7697
Add route setting
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
9 deletions
app.js
routes/select.js
views/select.pug
app.js
View file @
4a52190
...
...
@@ -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
...
...
routes/select.js
View file @
4a52190
...
...
@@ -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
...
...
views/select.pug
View file @
4a52190
...
...
@@ -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
') 검사!
...
...
Please
register
or
login
to post a comment