chore(netlify): proxy API requests to backend - #19
Conversation
✅ Deploy Preview for fanciful-cannoli-268c0c ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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.tomlwith 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.
| [build] | ||
| command = "npm run build" | ||
| publish = "dist/portfolio/browser" |
| [[redirects]] | ||
| from = "/api/*" | ||
| to = "https://kamycoding-api.apps.apply.build/api/:splat" | ||
| status = 200 | ||
| force = true |
There was a problem hiding this comment.
💡 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".
|
|
||
| [[redirects]] | ||
| from = "/api/*" | ||
| to = "https://kamycoding-api.apps.apply.build/api/:splat" |
There was a problem hiding this comment.
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 👍 / 👎.
No description provided.