2026-03-12 17:56:52 +05:30
|
|
|
import axios from "axios";
|
|
|
|
|
|
|
|
|
|
const api = axios.create({
|
2026-04-16 19:49:06 +05:30
|
|
|
baseURL: import.meta.env.VITE_API_URL,
|
2026-03-12 17:56:52 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
|
|
api.interceptors.request.use((config) => {
|
|
|
|
|
const token = localStorage.getItem("token");
|
|
|
|
|
|
|
|
|
|
if (token) {
|
|
|
|
|
config.headers.Authorization = `Bearer ${token}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default api;
|