Last active
February 16, 2019 14:36
-
-
Save tarusharora/711bd897006e1ac81f97fbfe6075206e to your computer and use it in GitHub Desktop.
adaptor to connect with the outside world using httpClient.js
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 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