feat: nextjs setup and configuration (lib, store, css, assets)

This commit is contained in:
parsa committed 2026-06-12 01:00:54 +03:30
1 parent eff6c00a9c
commit c5a1b8e5d2
17 files changed
+1933 -17

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import axios from 'axios';
const api = axios.create({
baseURL: '/api',
timeout: 10000,
headers: {
'Content-Type': 'application/json',
},
});
// Interceptor to add auth token in the future
api.interceptors.request.use(
(config) => {
const token = localStorage.getItem('accessToken');
if (token && config.headers) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
},
(error) => Promise.reject(error)
);
export default api;