File size: 353 Bytes
a7aae55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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>