module.exports mount an array with the api data

0

Well, I have the following problem, so I can not solve it in any way.

Well I have a config.js script

module.exports = {
    "adsense": {
        "bloco728x90": {
            "google_ad_client": "ca-pub-x",
            "google_ad_slot": 00
        }
    },
};

But this information I wanted to get from api localhost / api / adsense is to mount the array with the received data.

Using http.get() I can list the received data, just not able to use http.get along with module.exports to mount config.js without having to edit the file every time I update the information in api.

    
asked by anonymous 31.05.2017 / 21:50

1 answer

0

There is a package on the node that is just for this.

link

You pass the environment context and it gives you the right settings.

I hope I have helped

    
31.05.2017 / 22:19