Vite.config.ts #18761
Unanswered
Mohameddiallo728
asked this question in
Q&A
Vite.config.ts
#18761
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello every one, I was wondering if some ever face to this problem :
I have a fetch interceptor axios
const service = axios.create({
baseURL:
${API}
,timeout: 60000,
});
// API Request interceptor
service.interceptors.request.use((config: any) => {
const token = localStorage.getItem(TOKEN_NAME);
}, error => {
Promise.reject(error).then()
})
But In My vite config the token is no sent when redirecting request to the target
export default defineConfig({
plugins: [react()],
server: {
proxy: {
'/api/v1': {
target: 'TARGET_LINK`',
changeOrigin: true,
secure: true,
},
},
},
build: {
outDir: 'build',
emptyOutDir: true,
},
});
Anyone ?
Beta Was this translation helpful? Give feedback.
All reactions