A web app I am writing in JavaScript using node.js. I use Foreman, but I don’t want to manually restart the server every time I change my code. Can I tell Foreman to reload the entire web app before handling an HTTP request (i.e. restart the node process)?
A web app I am writing in JavaScript using node.js. I use Foreman, but
Share
Here’s an adjusted version of Pendlepants solution. Foreman looks for an .env file to read environment variables. Rather than adding a wrapper, you can just have Foreman switch what command it uses to start things up:
In .env:
In dev.env:
In your Procfile:
By default, Foreman will read from .env (in Production), but in DEV just run this: