Transcript from the "Keeping an app running" Lesson
>> Jem Young: So how do we keep our app up and running? Currently we have to run note app every time and kill it then make a change, run GULP, make a change, and then do that over and over. We don't wanna do that. There's better ways to do that.
[00:00:09] We're engineers. A good tenant of a good engineers is they're lazy. They do not wanna repeat themselves over and over again that's what we have scripts. That's true ask any engineers you've been around awhile they're very, very lazy, as they should be. So we're gonna use Forever. Forever is a process manager and it's gonna keep our app up and running indefinitely until we kill it.
[00:00:30] Or there's some sort of error that causes it to error out where it can't restart but it'll keep it up, so that way we run forever, and it's just gonna run to the background and we don't have to worry about it anymore. It's just always gonna be running.
>> Jem Young: And I will go ahead and do it as well.
>> Jem Young: And those optional dependencies are fine, it won't affect anything. So now, if I say forever start app.js. Instead of saying node.js, we can start app, because it defaults to a node system. Hit Enter and now our app's up and running.
>> Jem Young: But we can keep using the command line as we will and let's just double check that the app is working. So go to gem.party and it's still up and running. Yes I didn't add to my HTML cuz I am a lazy, lazy person, but I can do HTML, trust me.
[00:02:08] So our app is up and running. And it's up and running in the background now. It's gonna stay up and running until we stop it. So to stop a Forever script, we're just gonna say forever stopall. And that's gonna stop our node process. Refresh, it's a bad gateway cuz node is no longer running.
[00:02:28] That's the great thing about Forever, once you get it up and running, it just runs forever, and you don't have to worry about it.