Skip to content

Fall back to next free port when preferred port is busy in development - #517

Open
hammadsaj wants to merge 2 commits into
mainfrom
feat/dev-dynamic-port
Open

Fall back to next free port when preferred port is busy in development#517
hammadsaj wants to merge 2 commits into
mainfrom
feat/dev-dynamic-port

Conversation

@hammadsaj

Copy link
Copy Markdown
Collaborator

Summary

  • In development/debug, if CORTEX_PORT is already in use, bind the next available port instead of failing with EADDRINUSE
  • Log a warning when falling back and update config/CORTEX_PORT to the bound port
  • Production still fails hard if the preferred port is busy

Test plan

  • With nothing on 4000, npm start / npm run dev binds to 4000 as usual
  • With another process on 4000, the server binds to the next free port and logs the fallback warning
  • Confirm GraphQL playground opens at the logged URL
  • npm test -- tests/unit/server/listenHttpServer.test.js

Made with Cursor

hammadsaj and others added 2 commits August 4, 2026 09:50
…velopment.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant