You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
413 B
TypeScript
15 lines
413 B
TypeScript
import axios from "axios";
|
|
|
|
export const API_URL = `https://chess.beknazaryanstudio.ru:8080/api`
|
|
|
|
const $api = axios.create({
|
|
withCredentials: true,
|
|
baseURL: API_URL
|
|
})
|
|
|
|
$api.interceptors.request.use(config => {
|
|
config.headers.Authorization = `Bearer ${localStorage.getItem('token')}`; // eslint-disable-line @typescript-eslint/restrict-template-expressions
|
|
return config;
|
|
})
|
|
|
|
export default $api; |