Created
April 14, 2016 09:02
-
-
Save lesniakania/b1e01759f11a3bdd73a36480f88c3c36 to your computer and use it in GitHub Desktop.
This file contains 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
'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