Skip to content

Instantly share code, notes, and snippets.

@tarusharora
Created February 16, 2019 13:40
Show Gist options
  • Save tarusharora/efa3ebea89b9911a5ff04eb551b63c21 to your computer and use it in GitHub Desktop.
Save tarusharora/efa3ebea89b9911a5ff04eb551b63c21 to your computer and use it in GitHub Desktop.
http client using request-promise-native
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