This guide moves the local service to another port and points the app at it. Use it when 4317 is taken or you run two checkouts side by side.

Move the service

Set REDACT_QVAC_PORT when you start it:
The service always binds to 127.0.0.1. It can’t be reached from other machines. For the sandboxed service, the same variable works:

Point the app at it

The browser reads the service URL from NEXT_PUBLIC_REDACT_QVAC_URL. Next.js inlines NEXT_PUBLIC_* variables when it compiles, so set it on the command that builds or serves the app:
For a production build, set it on npm run build, not only on npm run start.

Change the app’s port

The app port is independent of the service:
The service accepts requests from any http://localhost:* or http://127.0.0.1:* origin, so no service change is needed. If you run the browser tests against another app port, set REDACT_BASE_URL, for example REDACT_BASE_URL=http://localhost:3200.