Eunsu486

modify category.js

...@@ -6,22 +6,17 @@ require('dotenv').config(); ...@@ -6,22 +6,17 @@ require('dotenv').config();
6 /* GET home page. */ 6 /* GET home page. */
7 let GU_CODE; 7 let GU_CODE;
8 let ANIMAL_INFO_API_KEY = process.env.ANIMAL_API_KEY; 8 let ANIMAL_INFO_API_KEY = process.env.ANIMAL_API_KEY;
9 -let user_gu; 9 +let userLocation;
10 let user_latitude; 10 let user_latitude;
11 let user_longitude; 11 let user_longitude;
12 -user_gu = 강북구; 12 +userLocation = 강북구;
13 -/*
14 -http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03
15 -?serviceKey=88dc66a7-9143-4af3-9f7b-098355b2c7f8&numOfRows=10&pageNo=1&keyword=동물병원
16 -&where=강북구
17 13
18 - System.out.println(Arrays.toString(hospitals)); 14 +/* System.out.println(Arrays.toString(hospitals));*/
19 15
20 -*/
21 router.get('/hospital', function (req, res) { 16 router.get('/hospital', function (req, res) {
22 let institute_url = 'http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03'; 17 let institute_url = 'http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03';
23 let qs = `?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=10&pageNo=2&keyword=동물병원 18 let qs = `?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=10&pageNo=2&keyword=동물병원
24 - &where=${user_gu}`; 19 + &where=${userLocation}`;
25 20
26 request({ 21 request({
27 url: institute_url + qs, 22 url: institute_url + qs,
......