Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the frontend API configuration to use relative paths instead of absolute URLs, enabling the application to work correctly when deployed behind an ingress controller that routes both frontend and backend on the same origin.
Changes:
- Changed the default API base URL from
http://127.0.0.1:8001to an empty string (relative path)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // API Configuration | ||
| api: { | ||
| baseUrl: import.meta.env.VITE_API_BASE_URL || "http://127.0.0.1:8001", | ||
| baseUrl: import.meta.env.VITE_API_BASE_URL || "", |
There was a problem hiding this comment.
This change updates the default baseUrl from an absolute URL to a relative path (empty string), which is appropriate for production deployment where the frontend and backend are served from the same origin via ingress routing. However, this PR is titled "remove duplicated /api/v1 endpoints" but only changes the config file.
There are hardcoded "/api/v1/..." paths in reportAgentService.js (lines 89, 114, 138, 159) that will now result in duplicate path segments like "/api/v1/api/v1/agents/report/analyze" when combined with the apiUrl getter. These should use the already-defined config.api.endpoints.agents.report paths instead (analyze, history, delete, download).
If these reportAgentService.js changes are in a separate commit or file not shown here, please ensure they are included. Otherwise, this PR is incomplete and will break the report agent API calls.
…dpoints