Created
February 16, 2019 13:40
-
-
Save tarusharora/efa3ebea89b9911a5ff04eb551b63c21 to your computer and use it in GitHub Desktop.
http client using request-promise-native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('request-promise-native'); | |
const nconf = require('nconf'); | |
const externalAPITimeout = nconf.get('app.externalAPITimeout'); | |
const getRequest = ({url, options}) => request.get(url, {...options, timeout: externalAPITimeout, json:true}); | |
module.exports = { | |
getRequest | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment