18 lines
374 B
TypeScript
Raw Normal View History

2025-10-21 01:14:13 +07:00
import axios from 'axios'
axios.defaults.withCredentials = false
export const API_URL = import.meta.env.VITE_APP_API
const instance = axios.create({
baseURL: API_URL,
2025-10-24 22:49:46 +07:00
headers: {
'Content-Type': 'application/json',
2025-10-21 01:14:13 +07:00
},
2025-10-24 22:49:46 +07:00
})
2025-10-21 01:14:13 +07:00
export const setLocaleApi = (locale: string) => {
instance.defaults.headers.common['lang'] = locale
}
export default instance