Open svicalifornia opened 2 years ago
And no, using the -p
/--port
option is not a suitable workaround for this request. I specifically want chalet
to assign the port numbers and ensure that each server will have a unique port number. However, I also want chalet
to reuse a port number when a server is killed and restarted.
The
chalet
CLI has arun
command, which sets up and runs a temporary server, outputs the server's logs to STDOUT, and removes the server config (to clean up) when the server process has stopped.However, if I need to stop the server and restart it for some reason, then it will run under a different port number the second time (typically the next number in some sequence). If I switch to the browser tab where I had loaded the app in its first run, it will have the first port number in its URL, but that port number is no longer being used — therefore reloading that tab will fail with a server-not-found error.
It would be great if the
chalet
daemon would remember servers previouslyrun
and their assigned port numbers, so that if another server isrun
with the same name, the previously used port number could be reused. This could simply be an in-memory hash that would persist only while thechalet
daemon is running. Therun
command would still clear the server's temporary config file when therun
command exits, but just keep the port number in an entry for that server name in the daemon's memory.