Skip to content

Instantly share code, notes, and snippets.

@tarusharora
Last active February 16, 2019 14:36
Show Gist options
  • Save tarusharora/711bd897006e1ac81f97fbfe6075206e to your computer and use it in GitHub Desktop.
Save tarusharora/711bd897006e1ac81f97fbfe6075206e to your computer and use it in GitHub Desktop.
adaptor to connect with the outside world using httpClient.js
const nconf =require('nconf');
const joinUrl = require('url-join');
const { getRequest } = require('../utils/httpClient');
const usersAPIUrl = nconf.get('url.usersAPI');
const getUsers = ({page = 1}) => getRequest({
url: joinUrl(usersAPIUrl, 'users', `?page=${page}`)
})
module.exports = {
getUsers
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment