import axios from "axios";

const axiosInstance = axios.create({
    baseURL: process.env.REACT_APP_API_Address,
});

axiosInstance.interceptors.request.use(async function (config) {
    // const search = window.location.search;
    // const params = new URLSearchParams(search)
    const token = localStorage.getItem("token") && localStorage.getItem("token")
    config.headers.Authorization = 'Bearer ' + token
    // config.params = params && params
    return await config;
});

export default axiosInstance;