You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
274 B

  1. import axios from 'axios';
  2. axios.defaults.xsrfCookieName = 'csrftoken';
  3. axios.defaults.xsrfHeaderName = 'X-CSRFToken';
  4. const baseUrl = window.location.href.split('/').slice(3, 5).join('/');
  5. const HTTP = axios.create({
  6. baseURL: `/v1/${baseUrl}`,
  7. });
  8. export default HTTP;