structure

This commit is contained in:
hamid zarghami
2025-08-26 22:17:42 +03:30
commit c69d4ea60b
100 changed files with 9431 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import axios from "axios";
import { getToken } from "./func";
const axiosInstance = axios.create({
baseURL: import.meta.env.VITE_BASE_URL || "http://localhost:3000/api",
});
axiosInstance.interceptors.response.use(
(response) => response,
(error) => {
return Promise.reject(error);
}
);
axiosInstance.interceptors.request.use(async function (config) {
const token = getToken();
config.headers.Authorization = "Bearer " + token;
return config;
});
export default axiosInstance;