Initial Commit

This commit is contained in:
Koncept Kit
2025-12-05 16:40:33 +07:00
parent 0834f12410
commit 94c7d5aec0
91 changed files with 20446 additions and 0 deletions

17
src/utils/api.js Normal file
View File

@@ -0,0 +1,17 @@
import axios from 'axios';
const API_URL = process.env.REACT_APP_BACKEND_URL;
export const api = axios.create({
baseURL: `${API_URL}/api`,
});
api.interceptors.request.use((config) => {
const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
});
export default api;