import axios from "axios";

export const api = axios.create({
    baseURL: "https://192.168.1.2:5227/api/",
    validateStatus: (status) => status < 500,
    withCredentials: true,
    headers: { 'Content-Type': 'application/json' }
});

api.interceptors.response.use(response => {
    response.status === 401
    if (response.status === 401) {
        window.location.replace("/login");
    }
    return response;
})
