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-02 18:42:28 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8babe67526aaa6f4cb7201a65634ad22eea7736c
8babe675
1 parent
cc047411
Test food category
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
11 deletions
routes/category.js
views/category.ejs
routes/category.js
View file @
8babe67
...
...
@@ -15,12 +15,12 @@ router.post('/', function(req, res) {
let
xyList
=
[];
console
.
log
(
userLocation
);
// console.log(req);
let
YOUR
_API_KEY
=
process
.
env
.
KAKAO_APIKEY
;
let
KAKAO
_API_KEY
=
process
.
env
.
KAKAO_APIKEY
;
let
kakaoOptions
=
{
url
:
'https://dapi.kakao.com/v2/local/search/address.json'
,
method
:
'GET'
,
headers
:
{
'Authorization'
:
`KakaoAK
${
YOUR
_API_KEY
}
`
'Authorization'
:
`KakaoAK
${
KAKAO
_API_KEY
}
`
},
qs
:
{
query
:
userLocation
...
...
@@ -40,7 +40,24 @@ router.post('/', function(req, res) {
});
router
.
get
(
'/food'
,
function
(
req
,
res
)
{
res
.
send
(
'This is food'
);
// 맛집 리스트 조회
let
GYEONGI_API_KEY
=
process
.
env
.
GYEONGGI_APIKEY
;
let
sigun_cd
=
41110
;
let
url
=
'https://openapi.gg.go.kr/PlaceThatDoATasteyFoodSt'
;
let
qs
=
`?KEY=
${
GYEONGI_API_KEY
}
&SIGUN_CD=
${
sigun_cd
}
`
;
request
({
url
:
url
+
qs
,
method
:
'GET'
},
function
(
err
,
response
,
body
)
{
if
(
!
err
&&
res
.
statusCode
==
200
)
{
let
re
=
body
;
console
.
log
(
body
);
res
.
send
(
re
);
}
});
});
router
.
get
(
'/school'
,
function
(
req
,
res
)
{
res
.
send
(
'This is school'
);
...
...
views/category.ejs
View file @
8babe67
...
...
@@ -29,7 +29,7 @@
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
음식
</h5>
<p
class=
"card-text"
>
주변 음식점의 수
</p>
<a
href=
"/
select
/food"
class=
"btn btn-primary"
>
검사!
</a>
<a
href=
"/
category
/food"
class=
"btn btn-primary"
>
검사!
</a>
</div>
</div>
<div
class=
"card"
style=
"width: 18rem;"
>
...
...
@@ -37,7 +37,7 @@
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
학군
</h5>
<p
class=
"card-text"
>
주변 학교, 학원 환경
</p>
<a
href=
"/
select
/school"
class=
"btn btn-primary"
>
검사!
</a>
<a
href=
"/
category
/school"
class=
"btn btn-primary"
>
검사!
</a>
</div>
</div>
<div
class=
"card"
style=
"width: 18rem;"
>
...
...
@@ -45,7 +45,7 @@
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
공원
</h5>
<p
class=
"card-text"
>
주변 공원
</p>
<a
href=
"/
select
/park"
class=
"btn btn-primary"
>
검사!
</a>
<a
href=
"/
category
/park"
class=
"btn btn-primary"
>
검사!
</a>
</div>
</div>
<div
class=
"card"
style=
"width: 18rem;"
>
...
...
@@ -53,7 +53,7 @@
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
대중교통
</h5>
<p
class=
"card-text"
>
대중교통 편리도
</p>
<a
href=
"/
select
/transport"
class=
"btn btn-primary"
>
검사!
</a>
<a
href=
"/
category
/transport"
class=
"btn btn-primary"
>
검사!
</a>
</div>
</div>
<div
class=
"card"
style=
"width: 18rem;"
>
...
...
@@ -61,7 +61,7 @@
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
안전
</h5>
<p
class=
"card-text"
>
주변 경찰서, 범죄자 인근~
</p>
<a
href=
"/
select
/safe"
class=
"btn btn-primary"
>
검사!
</a>
<a
href=
"/
category
/safe"
class=
"btn btn-primary"
>
검사!
</a>
</div>
</div>
<div
class=
"card"
style=
"width: 18rem;"
>
...
...
@@ -69,7 +69,7 @@
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
여가
</h5>
<p
class=
"card-text"
>
주변 문화시설
</p>
<a
href=
"/
select
/culture"
class=
"btn btn-primary"
>
검사!
</a>
<a
href=
"/
category
/culture"
class=
"btn btn-primary"
>
검사!
</a>
</div>
</div>
<div
class=
"card"
style=
"width: 18rem;"
>
...
...
@@ -77,7 +77,7 @@
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
쇼핑
</h5>
<p
class=
"card-text"
>
주변 백화점, 마트, 재래시장
</p>
<a
href=
"/
select
/culture"
class=
"btn btn-primary"
>
검사!
</a>
<a
href=
"/
category
/culture"
class=
"btn btn-primary"
>
검사!
</a>
</div>
</div>
<div
class=
"card"
style=
"width: 18rem;"
>
...
...
@@ -85,7 +85,7 @@
<div
class=
"card-body"
>
<h5
class=
"card-title"
>
운동
</h5>
<p
class=
"card-text"
>
주변 운동시설
</p>
<a
href=
"/
select
/culture"
class=
"btn btn-primary"
>
검사!
</a>
<a
href=
"/
category
/culture"
class=
"btn btn-primary"
>
검사!
</a>
</div>
</div>
</div>
...
...
Please
register
or
login
to post a comment