Skip to content

fix: route frontend API through Vercel HTTP rewrite#68

Merged
Benevanio merged 1 commit into
developfrom
feature/vps-secure-integration
Apr 7, 2026
Merged

fix: route frontend API through Vercel HTTP rewrite#68
Benevanio merged 1 commit into
developfrom
feature/vps-secure-integration

Conversation

@Benevanio

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings April 7, 2026 15:10
@vercel

vercel Bot commented Apr 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
painel-vagas Ready Ready Preview, Comment Apr 7, 2026 3:10pm

@Benevanio Benevanio self-assigned this Apr 7, 2026
@Benevanio
Benevanio merged commit e50a6a7 into develop Apr 7, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in JobAtlas – Kanban Apr 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the frontend deployment configuration to route /api/* requests through a Vercel rewrite, removing the need for a Vercel-hostname-specific API base URL override in the client.

Changes:

  • Added a vercel.json rewrite to forward /api/* requests to the backend origin.
  • Simplified getApiBaseUrl() so production can rely on relative /api/* calls (rewrites/proxies) instead of hostname detection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
frontend/vercel.json Introduces a Vercel rewrite to proxy frontend /api/* traffic to the backend.
frontend/src/services/jobsService.ts Removes Vercel-hostname special-casing so API calls can use relative paths and be handled by the rewrite.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/vercel.json
"rewrites": [
{
"source": "/api/(.*)",
"destination": "http://jobsglobalscraper.ddns.net/api/$1"

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rewrite destination is using plain HTTP. This means traffic between Vercel and the backend is unencrypted and can also lead to redirects/mixed-protocol issues (and some Vercel configurations only allow HTTPS external destinations). Prefer using an HTTPS destination if the backend supports it; if it doesn’t, consider terminating TLS in front of the backend (or proxying through a Vercel Function/Edge) rather than hard-coding an HTTP origin here.

Suggested change
"destination": "http://jobsglobalscraper.ddns.net/api/$1"
"destination": "https://jobsglobalscraper.ddns.net/api/$1"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants