const cheerio = require('cheerio')
    , fetch = require("node-fetch")
    , naverPlace = require("./naverPlace")




class Place {

    constructor() {
        this.remotehost = 'https://api.place.naver.com'
    }

    getData(params) {
        naverPlace[0].variables.input.start = params.start
        return fetch(this.remotehost + '/place/graphql', {
            body: JSON.stringify(naverPlace),
            method: 'POST',            
            headers: {
                'content-type': 'application/json'
            }
        }).then(res => res.json())
    }
}


module.exports = {place:new Place};