Skip to content

chore(netlify): proxy API requests to backend - #19

Merged
kamycoding merged 1 commit into
mainfrom
chore/netlify-api-proxy
Aug 9, 2026
Merged

chore(netlify): proxy API requests to backend#19
kamycoding merged 1 commit into
mainfrom
chore/netlify-api-proxy

Conversation

@kamycoding

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 9, 2026 17:23
@netlify

netlify Bot commented Aug 9, 2026

Copy link
Copy Markdown

Deploy Preview for fanciful-cannoli-268c0c ready!

Name Link
🔨 Latest commit a4cf142
🔍 Latest deploy log https://app.netlify.com/projects/fanciful-cannoli-268c0c/deploys/6a78b7a771d56a0008bacde0
😎 Deploy Preview https://deploy-preview-19--fanciful-cannoli-268c0c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@kamycoding
kamycoding merged commit 3f03491 into main Aug 9, 2026
5 checks passed
@kamycoding
kamycoding deleted the chore/netlify-api-proxy branch August 9, 2026 17:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a Netlify configuration to build and deploy the frontend, proxy /api/* requests to the backend service, and ensure SPA routes fall back to index.html.

Changes:

  • Introduces netlify.toml with Netlify build settings (npm run build, publish directory).
  • Adds a rewrite rule to proxy /api/* to the backend API host.
  • Adds a catch-all SPA rewrite to /index.html.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread netlify.toml
Comment on lines +1 to +3
[build]
command = "npm run build"
publish = "dist/portfolio/browser"
Comment thread netlify.toml
Comment on lines +5 to +9
[[redirects]]
from = "/api/*"
to = "https://kamycoding-api.apps.apply.build/api/:splat"
status = 200
force = true

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4cf142d68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread netlify.toml

[[redirects]]
from = "/api/*"
to = "https://kamycoding-api.apps.apply.build/api/:splat"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve client IPs before proxying the rate-limited API

When the site uses this Netlify rewrite, the upstream TCP peer seen by Express is a Netlify proxy rather than the browser. The backend does not configure trust proxy or otherwise extract a validated client address, while the limiter in server/src/app.ts:43-52 uses its default IP key. Consequently, visitors routed through the same Netlify egress address share the five-request-per-15-minute contact limit and can block one another. Configure the backend to trust the known proxy chain or explicitly derive a validated client IP before routing production traffic through this proxy.

Useful? React with 👍 / 👎.

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