import axios from "axios";

export const API_URL = `http://localhost:8089/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;