category.js
882 Bytes
var express = require('express');
var router = express.Router();
var request = require('request');
var convert = require('xml-js').parseString;
require('dotenv').config();
/* GET home page. */
let GU_CODE;
let ANIMAL_INFO_API_KEY = process.env.REACT_APP_API_KEY;
let user_gu;
let user_latitude;
let user_longitude;
router.get('/hospital', function (req, res) {
let pet_url = `http://api.kcisa.kr/openapi/service/rest/convergence2019/getConver03?serviceKey=${ANIMAL_INFO_API_KEY}&numOfRows=10&pageNo=1&keyword=%EB%8F%99%EB%AC%BC%EB%B3%91%EC%9B%90&where=%EA%B0%95%EB%B6%81%EA%B5%AC`;
let petOption = {
url : pet_url,
method : 'GET'
};
request(pet_url, function(err, response, body){
if(err){
console.log(err)
}
console.log(body)
res.send("finish");
})
});
module.exports = router;