With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?
- Go to
/etc/init/
$ sudo vim yourapp.conf
- Paste script.conf
$ sudo start yourapp
- And when you wanna kill the process
$ sudo stop yourapp
Thanks to [kvz.io] (http://kvz.io/blog/2009/12/15/run-nodejs-as-a-service-on-ubuntu-karmic/) for this!
looks too easy! haha can't wait to try it, thx! ... and 3 hours later, voila! It worked, but I had to reconfigure some constants to work with nodemon (local dev) and this script (prod). I had some paths set with fs.realpathSync, then tried to use __dirname but ended up having to use path.resolve(__dirname, '..') [+ '/whatever'] -- Just putting it out there in case anyone else runs into similar issues. (I'm new to NodeJS if you couldn't tell, but stoked on it)