I make API call in react like below.
First, there is an API address in html script.
<script
type="text/javascript"
src="https://dapi.kakao.com/v2/maps/sdk.js?appkey=s=services"
></script>
Second, get some result using method.
getCoor = () => {
console.log(this.addressState.departure.road);
const geocoder = new window.daum.maps.services.Geocoder();
geocoder.addressSearch(this.addressState.departure.road, (result, status) => {
if (status === window.daum.maps.services.Status.OK) {
console.log(result[0].x, result[0].y);
}
});
};
And, now I wanna make this in Nodejs.
But I don't know where I should put the method function in the POST request.
Could you recommend some solution?
rp({
method: 'POST',
uri: `https://dapi.kakao.com/v2/maps/sdk.js?appkey=${
process.env.DAUM_GEOCODE
}&libraries=services`,
data:{}
})
.then((response) => {
console.log(response);
})}