Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
'use strict'
import Axios from 'axios';
const BASE_URL = 'http://localhost:3000/api';
class ApiConnector {
get(path, data = {}) {
return Axios.get(`${BASE_URL}${path}`, { params: data });
}
post(path, data) {
return Axios.post(`${BASE_URL}${path}`, data);
}
}
const connector = new ApiConnector();
export default connector;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment