feat(vite): add server proxy to handle CORS for API requests

This commit is contained in:
InfinityPacer
2024-10-10 15:41:02 +08:00
parent 505773043b
commit 54046a4717
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -151,4 +151,14 @@ export default defineConfig({
exclude: ['vuetify'],
entries: ['./src/**/*.vue'],
},
server: {
proxy: {
'/api/v1': {
target: 'http://localhost:3001',
changeOrigin: true,
secure: false,
cookieDomainRewrite: 'localhost',
},
},
},
})