Showing
2 changed files
with
28 additions
and
11 deletions
... | @@ -15,12 +15,12 @@ router.post('/', function(req, res) { | ... | @@ -15,12 +15,12 @@ router.post('/', function(req, res) { |
15 | let xyList = []; | 15 | let xyList = []; |
16 | console.log(userLocation); | 16 | console.log(userLocation); |
17 | // console.log(req); | 17 | // console.log(req); |
18 | - let YOUR_API_KEY = process.env.KAKAO_APIKEY; | 18 | + let KAKAO_API_KEY = process.env.KAKAO_APIKEY; |
19 | let kakaoOptions = { | 19 | let kakaoOptions = { |
20 | url: 'https://dapi.kakao.com/v2/local/search/address.json', | 20 | url: 'https://dapi.kakao.com/v2/local/search/address.json', |
21 | method: 'GET', | 21 | method: 'GET', |
22 | headers: { | 22 | headers: { |
23 | - 'Authorization': `KakaoAK ${YOUR_API_KEY}` | 23 | + 'Authorization': `KakaoAK ${KAKAO_API_KEY}` |
24 | }, | 24 | }, |
25 | qs: { | 25 | qs: { |
26 | query: userLocation | 26 | query: userLocation |
... | @@ -40,7 +40,24 @@ router.post('/', function(req, res) { | ... | @@ -40,7 +40,24 @@ router.post('/', function(req, res) { |
40 | }); | 40 | }); |
41 | 41 | ||
42 | router.get('/food', function(req, res) { | 42 | router.get('/food', function(req, res) { |
43 | - res.send('This is food'); | 43 | + |
44 | + // 맛집 리스트 조회 | ||
45 | + let GYEONGI_API_KEY = process.env.GYEONGGI_APIKEY; | ||
46 | + let sigun_cd = 41110; | ||
47 | + let url = 'https://openapi.gg.go.kr/PlaceThatDoATasteyFoodSt'; | ||
48 | + let qs = `?KEY=${GYEONGI_API_KEY}&SIGUN_CD=${sigun_cd}`; | ||
49 | + | ||
50 | + request({ | ||
51 | + url: url + qs, | ||
52 | + method: 'GET' | ||
53 | + }, function(err, response, body) { | ||
54 | + if (!err && res.statusCode == 200) { | ||
55 | + let re = body; | ||
56 | + console.log(body); | ||
57 | + res.send(re); | ||
58 | + } | ||
59 | + }); | ||
60 | + | ||
44 | }); | 61 | }); |
45 | router.get('/school', function(req, res) { | 62 | router.get('/school', function(req, res) { |
46 | res.send('This is school'); | 63 | res.send('This is school'); | ... | ... |
... | @@ -29,7 +29,7 @@ | ... | @@ -29,7 +29,7 @@ |
29 | <div class="card-body"> | 29 | <div class="card-body"> |
30 | <h5 class="card-title">음식</h5> | 30 | <h5 class="card-title">음식</h5> |
31 | <p class="card-text">주변 음식점의 수</p> | 31 | <p class="card-text">주변 음식점의 수</p> |
32 | - <a href="/select/food" class="btn btn-primary">검사!</a> | 32 | + <a href="/category/food" class="btn btn-primary">검사!</a> |
33 | </div> | 33 | </div> |
34 | </div> | 34 | </div> |
35 | <div class="card" style="width: 18rem;"> | 35 | <div class="card" style="width: 18rem;"> |
... | @@ -37,7 +37,7 @@ | ... | @@ -37,7 +37,7 @@ |
37 | <div class="card-body"> | 37 | <div class="card-body"> |
38 | <h5 class="card-title">학군</h5> | 38 | <h5 class="card-title">학군</h5> |
39 | <p class="card-text">주변 학교, 학원 환경</p> | 39 | <p class="card-text">주변 학교, 학원 환경</p> |
40 | - <a href="/select/school" class="btn btn-primary">검사!</a> | 40 | + <a href="/category/school" class="btn btn-primary">검사!</a> |
41 | </div> | 41 | </div> |
42 | </div> | 42 | </div> |
43 | <div class="card" style="width: 18rem;"> | 43 | <div class="card" style="width: 18rem;"> |
... | @@ -45,7 +45,7 @@ | ... | @@ -45,7 +45,7 @@ |
45 | <div class="card-body"> | 45 | <div class="card-body"> |
46 | <h5 class="card-title">공원</h5> | 46 | <h5 class="card-title">공원</h5> |
47 | <p class="card-text">주변 공원</p> | 47 | <p class="card-text">주변 공원</p> |
48 | - <a href="/select/park" class="btn btn-primary">검사!</a> | 48 | + <a href="/category/park" class="btn btn-primary">검사!</a> |
49 | </div> | 49 | </div> |
50 | </div> | 50 | </div> |
51 | <div class="card" style="width: 18rem;"> | 51 | <div class="card" style="width: 18rem;"> |
... | @@ -53,7 +53,7 @@ | ... | @@ -53,7 +53,7 @@ |
53 | <div class="card-body"> | 53 | <div class="card-body"> |
54 | <h5 class="card-title">대중교통</h5> | 54 | <h5 class="card-title">대중교통</h5> |
55 | <p class="card-text">대중교통 편리도</p> | 55 | <p class="card-text">대중교통 편리도</p> |
56 | - <a href="/select/transport" class="btn btn-primary">검사!</a> | 56 | + <a href="/category/transport" class="btn btn-primary">검사!</a> |
57 | </div> | 57 | </div> |
58 | </div> | 58 | </div> |
59 | <div class="card" style="width: 18rem;"> | 59 | <div class="card" style="width: 18rem;"> |
... | @@ -61,7 +61,7 @@ | ... | @@ -61,7 +61,7 @@ |
61 | <div class="card-body"> | 61 | <div class="card-body"> |
62 | <h5 class="card-title">안전</h5> | 62 | <h5 class="card-title">안전</h5> |
63 | <p class="card-text">주변 경찰서, 범죄자 인근~</p> | 63 | <p class="card-text">주변 경찰서, 범죄자 인근~</p> |
64 | - <a href="/select/safe" class="btn btn-primary">검사!</a> | 64 | + <a href="/category/safe" class="btn btn-primary">검사!</a> |
65 | </div> | 65 | </div> |
66 | </div> | 66 | </div> |
67 | <div class="card" style="width: 18rem;"> | 67 | <div class="card" style="width: 18rem;"> |
... | @@ -69,7 +69,7 @@ | ... | @@ -69,7 +69,7 @@ |
69 | <div class="card-body"> | 69 | <div class="card-body"> |
70 | <h5 class="card-title">여가</h5> | 70 | <h5 class="card-title">여가</h5> |
71 | <p class="card-text">주변 문화시설</p> | 71 | <p class="card-text">주변 문화시설</p> |
72 | - <a href="/select/culture" class="btn btn-primary">검사!</a> | 72 | + <a href="/category/culture" class="btn btn-primary">검사!</a> |
73 | </div> | 73 | </div> |
74 | </div> | 74 | </div> |
75 | <div class="card" style="width: 18rem;"> | 75 | <div class="card" style="width: 18rem;"> |
... | @@ -77,7 +77,7 @@ | ... | @@ -77,7 +77,7 @@ |
77 | <div class="card-body"> | 77 | <div class="card-body"> |
78 | <h5 class="card-title">쇼핑</h5> | 78 | <h5 class="card-title">쇼핑</h5> |
79 | <p class="card-text">주변 백화점, 마트, 재래시장</p> | 79 | <p class="card-text">주변 백화점, 마트, 재래시장</p> |
80 | - <a href="/select/culture" class="btn btn-primary">검사!</a> | 80 | + <a href="/category/culture" class="btn btn-primary">검사!</a> |
81 | </div> | 81 | </div> |
82 | </div> | 82 | </div> |
83 | <div class="card" style="width: 18rem;"> | 83 | <div class="card" style="width: 18rem;"> |
... | @@ -85,7 +85,7 @@ | ... | @@ -85,7 +85,7 @@ |
85 | <div class="card-body"> | 85 | <div class="card-body"> |
86 | <h5 class="card-title">운동</h5> | 86 | <h5 class="card-title">운동</h5> |
87 | <p class="card-text">주변 운동시설</p> | 87 | <p class="card-text">주변 운동시설</p> |
88 | - <a href="/select/culture" class="btn btn-primary">검사!</a> | 88 | + <a href="/category/culture" class="btn btn-primary">검사!</a> |
89 | </div> | 89 | </div> |
90 | </div> | 90 | </div> |
91 | </div> | 91 | </div> | ... | ... |
-
Please register or login to post a comment