Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@AndrejGajdos
Created June 24, 2018 10:12
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 AndrejGajdos/a74c4af8e7a7f769221feea36d8fe4f9 to your computer and use it in GitHub Desktop.
Save AndrejGajdos/a74c4af8e7a7f769221feea36d8fe4f9 to your computer and use it in GitHub Desktop.
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