fix(proxy): add /backend proxy with rewrite to replace legacy per-route entries

This commit is contained in:
2026-08-06 16:37:31 +00:00
parent 6927c3ea32
commit 1e0956dcc8
+4 -25
View File
@@ -7,34 +7,13 @@ export default defineConfig({
host: '0.0.0.0',
port: 5173,
proxy: {
'/auth': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
},
'/inventory': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
},
'/objects': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
},
'/jobs': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
},
'/discoveries': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
},
'/relations': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
},
'/health': {
// All backend API calls go through /backend -> strips prefix
'/backend': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/backend/, ''),
},
// Local agent (unauthenticated)
'/api': {
target: 'http://127.0.0.1:8001',
changeOrigin: true,