Repository navigation
Route ported API groups to the .NET API and add one-command local dev - #20
Merged
Merged
Conversation
Add env-driven rewrites so the browser calls /api/v1 on the site's own origin and Next.js forwards each route group to its backend: cars to the ASP.NET Core API (nexorarent-api) when DOTNET_API_URL is set, everything else and /uploads to Express. Without EXPRESS_API_URL nothing changes. Add npm run setup to generate local env files with random secrets, npm run dev:dotnet to start the .NET API with server/.env, npm run dev:all to start all three services, and db:up/db:down for the MySQL container.
These groups are read-only on Express and are now ported and covered by the parity tests in nexorarent-api.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
client/next.config.ts: Next.js rewrites send/api/v1/cars,/locations,/extrasand/blogto the .NET API (DOTNET_API_URL) and everything else to Express (EXPRESS_API_URL). With noEXPRESS_API_URL, no rewrites are added and the client keeps callingNEXT_PUBLIC_API_URLdirectly.npm run setupwrites local.envfiles with random JWT secrets (never overwrites existing ones).npm run dev:allstarts Express, Next.js and the .NET API (dotnet watch) together.db:up/db:downmanage the Docker MySQL.The browser only talks to the Next.js origin, so the refresh-token cookie stays first-party.
Verified locally
/auth/me. Refresh and logout work through the proxy./carsand a car detail page render with no console errors.Deploy
On Vercel, set
EXPRESS_API_URL,DOTNET_API_URLandNEXT_PUBLIC_API_URL=/api/v1. To roll back a group, remove it fromDOTNET_ROUTE_GROUPS.