fix(node-player): proxy /api through vite dev server for same-origin SW
Service Worker only intercepts same-origin requests. In dev mode, API calls went directly to localhost:8085 (cross-origin), bypassing the SW. Now vite proxies /api to Rust API, keeping everything same-origin so the SW can inject Bearer tokens for audio/image requests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
VITE_FURUMI_API_URL=http://localhost:8085
|
# Leave empty — vite proxy handles /api in dev, same-origin in production
|
||||||
|
VITE_FURUMI_API_URL=
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ export default defineConfig({
|
|||||||
target: 'http://localhost:3001',
|
target: 'http://localhost:3001',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
|
'/api': {
|
||||||
|
target: 'http://localhost:8085',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user