Suyeon Jung

Test food category

......@@ -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');
......
......@@ -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>
......