Eunsu486

Merge branch 'eunsuu' into eunsu

...@@ -26,6 +26,8 @@ app.use(express.static(path.join(__dirname, 'public'))); ...@@ -26,6 +26,8 @@ app.use(express.static(path.join(__dirname, 'public')));
26 app.use('/', indexRouter); 26 app.use('/', indexRouter);
27 app.use('/users', usersRouter); 27 app.use('/users', usersRouter);
28 app.use('/category', categoryRouter); 28 app.use('/category', categoryRouter);
29 +app.use('/vendors/bootstrap', express.static(path.join(__dirname, "./node_modules/bootstrap/dist")));
30 +app.use(bodyParser.urlencoded({ extended: false }));
29 31
30 // catch 404 and forward to error handler 32 // catch 404 and forward to error handler
31 app.use(function (req, res, next) { 33 app.use(function (req, res, next) {
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 "_resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", 22 "_resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz",
23 "_shasum": "927d2f6947f7f1c19a316dd8eea3614e8b18f8e9", 23 "_shasum": "927d2f6947f7f1c19a316dd8eea3614e8b18f8e9",
24 "_spec": "xml-js@^1.6.11", 24 "_spec": "xml-js@^1.6.11",
25 - "_where": "C:\\Users\\se051\\OneDrive\\바탕 화면\\나의 대학라이프\\오픈소스SW개발\\텀프\\animal-Info", 25 + "_where": "C:\\Users\\owterm\\animal-Info",
26 "author": { 26 "author": {
27 "name": "Yousuf Almarzooqi", 27 "name": "Yousuf Almarzooqi",
28 "email": "ysf953@gmail.com" 28 "email": "ysf953@gmail.com"
......
1 { 1 {
2 - "_from": "xml2js", 2 + "_from": "xml2js@^0.4.23",
3 "_id": "xml2js@0.4.23", 3 "_id": "xml2js@0.4.23",
4 "_inBundle": false, 4 "_inBundle": false,
5 "_integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", 5 "_integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
6 "_location": "/xml2js", 6 "_location": "/xml2js",
7 "_phantomChildren": {}, 7 "_phantomChildren": {},
8 "_requested": { 8 "_requested": {
9 - "type": "tag", 9 + "type": "range",
10 "registry": true, 10 "registry": true,
11 - "raw": "xml2js", 11 + "raw": "xml2js@^0.4.23",
12 "name": "xml2js", 12 "name": "xml2js",
13 "escapedName": "xml2js", 13 "escapedName": "xml2js",
14 - "rawSpec": "", 14 + "rawSpec": "^0.4.23",
15 "saveSpec": null, 15 "saveSpec": null,
16 - "fetchSpec": "latest" 16 + "fetchSpec": "^0.4.23"
17 }, 17 },
18 "_requiredBy": [ 18 "_requiredBy": [
19 "#USER", 19 "#USER",
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
21 ], 21 ],
22 "_resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", 22 "_resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
23 "_shasum": "a0c69516752421eb2ac758ee4d4ccf58843eac66", 23 "_shasum": "a0c69516752421eb2ac758ee4d4ccf58843eac66",
24 - "_spec": "xml2js", 24 + "_spec": "xml2js@^0.4.23",
25 - "_where": "C:\\Users\\se051\\OneDrive\\바탕 화면\\나의 대학라이프\\오픈소스SW개발\\텀프\\animal-Info", 25 + "_where": "C:\\Users\\owterm\\animal-Info",
26 "author": { 26 "author": {
27 "name": "Marek Kubica", 27 "name": "Marek Kubica",
28 "email": "marek@xivilization.net", 28 "email": "marek@xivilization.net",
......
...@@ -28,12 +28,14 @@ router.post('/hospital', function (req, res) { ...@@ -28,12 +28,14 @@ router.post('/hospital', function (req, res) {
28 //api 28 //api
29 29
30 let pet_url = `http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=200&pageNo=1&keyword=${menu_encode}&where=${gu_select_encode}`; 30 let pet_url = `http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=200&pageNo=1&keyword=${menu_encode}&where=${gu_select_encode}`;
31 +
31 request(pet_url, function (err, response, body) { 32 request(pet_url, function (err, response, body) {
32 if (err) { 33 if (err) {
33 console.log(`err => ${err}`) 34 console.log(`err => ${err}`)
34 } 35 }
35 else { 36 else {
36 if (res.statusCode == 200) { 37 if (res.statusCode == 200) {
38 +
37 var hospital_list = []; 39 var hospital_list = [];
38 var titles = ''; 40 var titles = '';
39 41
...@@ -56,10 +58,12 @@ router.post('/hospital', function (req, res) { ...@@ -56,10 +58,12 @@ router.post('/hospital', function (req, res) {
56 appliance_list.push(itemList.item[i]); 58 appliance_list.push(itemList.item[i]);
57 } 59 }
58 60
61 +
59 } 62 }
60 } 63 }
61 64
62 //테스트용 console.log 65 //테스트용 console.log
66 +
63 for (i = 0; i < hospital_list.length; i++) { 67 for (i = 0; i < hospital_list.length; i++) {
64 titles = titles + hospital_list[i].title._text + '\n'; 68 titles = titles + hospital_list[i].title._text + '\n';
65 } 69 }
...@@ -327,3 +331,4 @@ router.post('/park', function (req, res) { ...@@ -327,3 +331,4 @@ router.post('/park', function (req, res) {
327 331
328 module.exports = router; 332 module.exports = router;
329 333
334 +
......
...@@ -2,4 +2,3 @@ var express = require('express'); ...@@ -2,4 +2,3 @@ var express = require('express');
2 var router = express.Router(); 2 var router = express.Router();
3 var path = require('path'); 3 var path = require('path');
4 router.use('/bootstrap', express.static(path.join(__dirname, "../node_modules/bootstrap/dist"))); 4 router.use('/bootstrap', express.static(path.join(__dirname, "../node_modules/bootstrap/dist")));
5 -module.exports = router;
...\ No newline at end of file ...\ No newline at end of file
......
1 +<!DOCTYPE html>
2 +<html lang="ko">
3 +
4 +<head>
5 + <meta charset="UTF-8">
6 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 + <link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap.min.css' />
8 + <link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-grid.min.css' />
9 + <link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-reboot.min.css' />
10 + <link rel='stylesheet' href='/css/category.css'>
11 + <link rel="preconnect" href="https://fonts.gstatic.com">
12 + <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300&display=swap" rel="stylesheet">
13 + <title>📝 진단 검사</title>
14 +</head>
15 +
16 +<body>
17 + <%- include('components/locationJumbotron') -%>
18 + <%- include('components/category') -%>
19 +</body>
20 +
21 +</html>
...\ No newline at end of file ...\ No newline at end of file
1 <ul class="nav nav-pills nav-stacked"> 1 <ul class="nav nav-pills nav-stacked">
2 - <li role="presentation" class="active"><a href="#">동물 병원</a></li> 2 + <li role="presentation" class="active"><a href="/category/hospital">동물 병원</a></li>
3 - <li role="presentation"><a href="#">동물 약국</a></li> 3 + <li role="presentation"><a href="/category/medicine">동물 약국</a></li>
4 - <li role="presentation"><a href="#">공원</a></li> 4 + <li role="presentation"><a href="/category/park">공원</a></li>
5 - <li role="presentation"><a href="#">동물 보호 시설</a></li> 5 + <li role="presentation"><a href="/category/protection">동물 보호 시설</a></li>
6 </ul> 6 </ul>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -98,13 +98,10 @@ ...@@ -98,13 +98,10 @@
98 <option value='강남구'>강남구</option> 98 <option value='강남구'>강남구</option>
99 </select> 99 </select>
100 </form> 100 </form>
101 - </div>
102 - </div>
103 -
104 101
105 - <footer id="footer"> 102 + <footer id="footer">
106 - <%- include("components/footer") -%> 103 + <%- include("components/footer") -%>
107 - </footer> 104 + </footer>
108 </body> 105 </body>
109 106
110 </html> 107 </html>
...\ No newline at end of file ...\ No newline at end of file
......
1 +<!DOCTYPE html>
2 +<html lang="ko">
3 +
4 +<head>
5 + <meta charset="UTF-8">
6 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 + <link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap.min.css' />
8 + <link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-grid.min.css' />
9 + <link rel='stylesheet' href='/vendors/bootstrap/css/bootstrap-reboot.min.css' />
10 + <link rel="preconnect" href="https://fonts.gstatic.com">
11 + <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300&display=swap" rel="stylesheet">
12 + <title>📝 결과</title>
13 +</head>
14 +
1 <body> 15 <body>
2 <%- include(`results/${category}`) -%> 16 <%- include(`results/${category}`) -%>
3 -</body>
...\ No newline at end of file ...\ No newline at end of file
17 +</body>
18 +
19 +</html>
...\ No newline at end of file ...\ No newline at end of file
......
1 -<h4>🌳 동물병원 현황</h4> 1 +<h4> 동물병원 현황</h4>
2 <table class="table"> 2 <table class="table">
3 - thead class="thead-dark"> 3 + <thead class="thead-dark">
4 - <tr> 4 + <tr>
5 - <th>동물병원명</th> 5 + <th>동물병원명</th>
6 - <th>도로명주소</th> 6 + </tr>
7 - </tr>
8 </thead> 7 </thead>
9 <tbody> 8 <tbody>
10 - <%for (var i=0; i <hospitals.length; i++){%> 9 + <tr>
11 - <tr> 10 + <td>
12 - <td> 11 + <%=titles%>
13 - <%=hospitals[i].PARK_NM%> 12 + </td>
14 - </td> 13 +
15 - <td> 14 + </tr>
16 - <%=hospitals[i].REFINE_ROADNM_ADDR%> 15 +
17 - </td>
18 - </tr>
19 - <%}%>
20 </tbody> 16 </tbody>
21 </table> 17 </table>
22 <p class="sum">총 동물병원 개수 : 18 <p class="sum">총 동물병원 개수 :
23 - <%=city_parks.length%> 19 + <%-hospital_list.length%>
24 </p> 20 </p>
...\ No newline at end of file ...\ No newline at end of file
......
1 -it's medicine page
...\ No newline at end of file ...\ No newline at end of file
1 +<h4> 동물약국 현황</h4>
2 +<table class="table">
3 + <thead class="thead-dark">
4 + <tr>
5 + <th>동물약국명</th>
6 + </tr>
7 + </thead>
8 + <tbody>
9 + <tr>
10 + <td>
11 +
12 + </td>
13 +
14 + </tr>
15 +
16 + </tbody>
17 +</table>
18 +<p class="sum">총 동물약국 개수 :
19 +
20 +</p>
...\ No newline at end of file ...\ No newline at end of file
......
1 -it's park page
...\ No newline at end of file ...\ No newline at end of file
1 +<h4>🌳 도시공원 현황</h4>
2 +<table class="table">
3 + <thead class="thead-dark">
4 + <tr>
5 + <th>도시공원명</th>
6 + </tr>
7 + </thead>
8 + <tbody>
9 + <tr>
10 + <td>
11 + <%=titles%>
12 + </td>
13 + </tr>
14 +
15 + </tbody>
16 +</table>
17 +<p class="sum">총 도시공원 개수 :
18 + <%=parks_list.length%>
19 +</p>
...\ No newline at end of file ...\ No newline at end of file
......
1 +<h4> 동물 보호소 현황</h4>
2 +<table class="table">
3 + <thead class="thead-dark">
4 + <tr>
5 + <th>동물 보호소명</th>
6 + </tr>
7 + </thead>
8 + <tbody>
9 + <tr>
10 + <td>
11 + <%=titles%>
12 + </td>
13 +
14 + </tr>
15 +
16 + </tbody>
17 +</table>
18 +<p class="sum">총 동물 보호소 개수 :
19 + <%=protection_list.length%>
20 +</p>
...\ No newline at end of file ...\ No newline at end of file