You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: Find available ports starting from 3000 #1642
I think this feature could be helpful, especially for beginners who may already have another local server running on port 3000.
However, changing ports automatically could also be confusing if the user expects the API to always be available at a specific URL.
A possible compromise could be:
1. Keep port 3000 as the default.
2. If port 3000 is already in use, show a clear error message.
3. Suggest the next available port, for example 3001.
4. Only auto-switch ports if the user enables it with an explicit flag.
For example:
json-server db.json --auto-port
This keeps the default behavior predictable while still giving users an easy option when port 3000 is already occupied.
If port:3000 is occupied by another service, json-server to find the next available port.