Created
June 24, 2018 10:12
-
-
Save AndrejGajdos/a74c4af8e7a7f769221feea36d8fe4f9 to your computer and use it in GitHub Desktop.
This file is part of project https://github.com/AndrejGajdos/auth-flow-spa-node-react
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
import axios from 'axios'; | |
import { API_ADDRESS } from 'config'; | |
export function get(path, params) { | |
const url = `${API_ADDRESS}${path}`; | |
return axios({ | |
method: 'get', | |
url, | |
params, | |
withCredentials: true, | |
}).then(resp => resp.data); | |
} | |
export function post(path, data, params) { | |
const url = `${API_ADDRESS}${path}`; | |
return axios({ | |
method: 'post', | |
url, | |
data, | |
params, | |
withCredentials: true, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment