Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the frontend’s production API routing strategy by moving Vercel-specific API targeting out of runtime hostname checks and into a Vercel rewrite rule, so the frontend can call /api/* on the same origin.
Changes:
- Added a
vercel.jsonrewrite to proxy/api/*requests to the external backend. - Removed the
window.location.hostnamespecial-case injobsServiceso API URLs are derived solely fromVITE_API_BASE_URLor fall back to relative/api/*paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/vercel.json | Adds Vercel rewrite to proxy /api/* to the backend origin. |
| frontend/src/services/jobsService.ts | Removes Vercel-hostname-based base URL override to rely on env/relative paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "rewrites": [ | ||
| { | ||
| "source": "/api/(.*)", | ||
| "destination": "http://jobsglobalscraper.ddns.net/api/$1" |
There was a problem hiding this comment.
destination is using plain HTTP to the backend (http://jobsglobalscraper.ddns.net/...). This sends API traffic from Vercel to the origin unencrypted and may also fail if the platform/origin enforces HTTPS. Prefer using the HTTPS endpoint (the repo already documents https://jobsglobalscraper.ddns.net) and consider making the origin configurable per environment (Preview vs Production) to avoid preview deployments proxying writes/scraper runs to the production backend.
| "destination": "http://jobsglobalscraper.ddns.net/api/$1" | |
| "destination": "https://jobsglobalscraper.ddns.net/api/$1" |
No description provided.