Skip to content

Instantly share code, notes, and snippets.

@smks
Last active December 2, 2018 13:33
Show Gist options
  • Save smks/7a86e9c5ffcf27a17a8e7594efb3adab to your computer and use it in GitHub Desktop.
Save smks/7a86e9c5ffcf27a17a8e7594efb3adab to your computer and use it in GitHub Desktop.
API to get people service
import axios from 'axios';
const GET_PEOPLE_ENDPOINT = `https://jsonplaceholder.typicode.com/users`;
class API {
constructor(api) {
this.api = api;
}
getPeople = () => {
return this.api.get(GET_PEOPLE_ENDPOINT);
};
}
export default new API(axios);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment