It seems the local server started with "heroku local web" does not watch for file changes and restart itself. How can I make it do this?
To use a different port, use the -p flag: heroku local -p 7000 . If you don't specify a port, 5000 is used.
If you have the Heroku CLI installed, you can run heroku restart in the folder of your application or run heroku restart --app application_name .
Define a Procfile Use a Procfile, a text file in the root directory of your application, to explicitly declare what command should be executed to start your app. The Procfile in the example app you deployed looks like this: web: npm start. This declares a single process type, web , and the command needed to run it.
The easiest way to do this is to run nodemon with heroku local
as the executable - i.e. nodemon --exec "heroku local"
.
However, heroku local
exits with a non-zero exit code for the default nodemon shutdown signal (SIGUSR2), so you need to add an additional flag to nodemon to set the interrupt signal to SIGTERM.
nodemon --exec "heroku local" --signal SIGTERM
(tested with [email protected], [email protected], [email protected])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With