2025-06-03 17:13:44 +03:30
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
const api = axios.create({
|
|
|
|
|
baseURL: process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000/api',
|
2025-06-08 15:52:05 +03:30
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
},
|
|
|
|
|
withCredentials: true, // Enable sending cookies with requests
|
2025-06-03 17:13:44 +03:30
|
|
|
});
|
|
|
|
|
|
|
|
|
|
api.interceptors.request.use(
|
|
|
|
|
(config) => {
|
|
|
|
|
return config;
|
|
|
|
|
},
|
|
|
|
|
(error) => Promise.reject(error),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default api;
|