I am running a nodejs server locally with Firebase emulators (using firebase emulators:start
). I have another version running on google cloud functions - but I also need something running locally.
When errors happen, my whole node process dies, and the emulator dies etc... and I have to go back and restart the process manually. Is there a way to automatically restart it when an error happens, such as using forever
? I tried with something like forever start firebase emulators:start
but that didn't work.
Due to how Firebase is built and operates, it does not support any such functionality of staying awake as a process virtually non-stop. You would most likely need to refactor your code in such a way that the process you need to keep alive indefinitely is separated from your code hosted by the firebase emulator.