chore: setup project for production

This commit is contained in:
afnaann
2025-02-19 17:00:55 +05:30
commit 12caeee710
271 changed files with 16199 additions and 0 deletions

23
utils/axios.js Normal file
View File

@@ -0,0 +1,23 @@
import axios from 'axios';
export const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL;
const authAxios = axios.create({
baseURL: backendUrl,
});
authAxios.interceptors.request.use(
(config) => {
const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `Token ${token}`;
}
return config;
},
(error) => {
console.error("Error in request interceptor:", error);
return Promise.reject(error);
}
);
export default authAxios;