17 lines
540 B
JavaScript
17 lines
540 B
JavaScript
import axios from "axios";
|
|
import { csrftoken, isBrowser } from "../utils/utils.js";
|
|
|
|
export const exoInstance = axios.create({
|
|
baseURL: `http://${process.env.NEXT_PUBLIC_HOST}/api/exos/`,
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
Accept: "application/json",
|
|
"Access-Control-Allow-Origin": "*",
|
|
"X-CSRFToken": csrftoken != undefined ? csrftoken : "",
|
|
Authorization: isBrowser
|
|
? localStorage.getItem("token") !== null
|
|
? `Token ${localStorage.getItem("token")}`
|
|
: null
|
|
: null,
|
|
},
|
|
}); |