mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 08:06:43 +08:00
feat(vite): add server proxy to handle CORS for API requests
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
VITE_API_BASE_URL=http://localhost:3001/api/v1/
|
VITE_API_BASE_URL=/api/v1/
|
||||||
VITE_PUBLIC_VAPID_KEY=BH3w49sZA6jXUnE-yt4jO6VKh73lsdsvwoJ6Hx7fmPIDKoqGiUl2GEoZzy-iJfn4SfQQcx7yQdHf9RknwrL_lSM
|
VITE_PUBLIC_VAPID_KEY=BH3w49sZA6jXUnE-yt4jO6VKh73lsdsvwoJ6Hx7fmPIDKoqGiUl2GEoZzy-iJfn4SfQQcx7yQdHf9RknwrL_lSM
|
||||||
|
|||||||
@@ -151,4 +151,14 @@ export default defineConfig({
|
|||||||
exclude: ['vuetify'],
|
exclude: ['vuetify'],
|
||||||
entries: ['./src/**/*.vue'],
|
entries: ['./src/**/*.vue'],
|
||||||
},
|
},
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/api/v1': {
|
||||||
|
target: 'http://localhost:3001',
|
||||||
|
changeOrigin: true,
|
||||||
|
secure: false,
|
||||||
|
cookieDomainRewrite: 'localhost',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user