Thursday 27 September 2018

[help] Saving result of a Request in a variable

I am creating an app using an API that provides some configuration settings as a json object that I can pull using Request. however, i would like to store this into a var config object in my index.js so I may pass it into any modules that may need the config info, much like the mongoose that i pass around my app.I have only been so far able to use the information in callbacks and a .then callback on a Promise. I have dug through SO and can't find much help on storing this in a way that is useful anywhere else and any guidance is appreciated.​

Submitted September 28, 2018 at 12:10AM by marconi_mamba

No comments:

Post a Comment