Let the API listen on the port the docs already name - #23
Open
krongggggg wants to merge 1 commit into
Open
Conversation
SERVER_PORT is what start.sh, Vite, and the ports table already use; the process only read PORT. Honour SERVER_PORT first, then PORT, so existing .env files keep working and the documented name actually moves the listener. Co-authored-by: krong <krongggggg@gmail.com>
krongggggg
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
August 20, 2026 02:44
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 this changes
The documented way to move the API is
SERVER_PORT.scripts/start.sh, the Vite/apiproxy, and the ports table already use that name. The server process itself only readPORT, which is what.env.exampleused to set.A clone that followed the docs and set
SERVER_PORTcould get Vite proxying to the new port while the API still listened onPORT=3001, andstart.shhealth-checking a port the process was not on.The API now honours
SERVER_PORT, thenPORT, then 3001. Existing.envfiles that only setPORTkeep working. Vite andstart.shfollow the same order so the listener, the proxy, and the health check stay on the same number..env.examplenow namesSERVER_PORTandAPP_PORTinstead of onlyPORT.Where it runs
Boundary and audit
Proof
bun run format:check— cleanbun run lint— exit 0bun run typecheck— app, server and worker all exit 0bun test server/tests/listen-port.test.ts— 5 pass, 0 failbun run build— app, server and worker all exit 0Test plan
SERVER_PORT(leavePORTat 3001 or unset) and confirmbun run devlistens and proxies on that portPORTand confirm the API still listens thereSERVER_PORTwins for the listener, the Vite proxy, andscripts/start.sh