Eunsu486

Merge branch 'eunsuu' into eunsu

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