Skip to content

Instantly share code, notes, and snippets.

@lesniakania
Created April 14, 2016 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesniakania/b1e01759f11a3bdd73a36480f88c3c36 to your computer and use it in GitHub Desktop.
Save lesniakania/b1e01759f11a3bdd73a36480f88c3c36 to your computer and use it in GitHub Desktop.
'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