Eunsu486

Make module

......@@ -30,15 +30,16 @@ router.get('/hospital', function (req, res) {
if (!err && res.statusCode == 200) {
let hospital_result = JSON.parse(body);
let hospitals = [];
for (let i = 0; i < hospital_result.Tbggibllbrm[1].row.length; i++) {
library = hospital_result.Tbggibllbrm[1].row[i];
if (userArea(library, 'REFINE_LOTNO_ADDR', user_target)) {
hospitals.push(library);
for (let i = 0; i < hospital_result.hr[1].row.length; i++) {
hospital = hospital_result.hr[1].row[i];
if (userArea(hospital, 'REFINE_LOTNO_ADDR', user_target)) {
hospitals.push(hospital);
}
}
console.log([hospitals);
res.render('result', { category: 'hospital', userLocation: userLocation });
}
})
});
\ No newline at end of file
});
module.exports = router;
\ No newline at end of file
......