ericclemmons / grunt-express-server

Grunt task for running an Express Server that works great with LiveReload + Watch/Regarde

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keepalive

baugarten opened this issue · comments

I'm looking at the documentation and I don't see any way to specify that we should restart the server on crash (such as in a production setting). Is there any way to do this?

Oh, interesting!

Is the scenario that you have some code that works fine when the server/task starts, but then you, for example, hit an end-point, a 500 is triggered, an error is thrown, and you want the server to come back up?

Sounds plausible & doable, and most importantly, testable!

:) the plan isn't really to error but for a variety of reasons a node server can crash in production (untested code path, out of memory, etc) so I would like to start my server knowing that if it dies for some strange reason, it will come back to life

Sent with my thumbs

On Jun 17, 2014, at 9:46 PM, Eric Clemmons notifications@github.com wrote:

Oh, interesting!

Is the scenario that you have some code that works fine when the server/task starts, but then you, for example, hit an end-point, a 500 is triggered, an error is thrown, and you want the server to come back up?

Sounds plausible & doable, and most importantly, testable!


Reply to this email directly or view it on GitHub.

Personally, I use forever (https://github.com/nodejitsu/forever) in production, since grunt nor grunt-express-server is really best suited for production environments.

My npm start is pretty much grunt build optimize && forever restart app/cluster.js.

Do you really want to have grunt running your process on production?

That's actually a good point. I don't. I'm going to go ahead and see myself out. Cheers!

I have no problem with restarting express via this task, but I wanted to be sure of the use-case before implementing it.

Thanks for the discussion!