Spaces:
Running
Running
| ts | |
| import axios from 'axios' | |
| const api = axios.create({ | |
| baseURL: import.meta.env.VITE_API_URL || 'http://localhost:4000', | |
| withCredentials: false | |
| }) | |
| api.interceptors.request.use(config => { | |
| const token = localStorage.getItem('lt-token') | |
| if (token) config.headers.Authorization = `Bearer ${token}` | |
| return config | |
| }) | |
| export default api | |
| </html> |