3

This feels like a dumb question, but it's remarkably hard to Google for: I have a Node script that provides an endpoint for a simple API used only in-house. I have no problem setting up the script to listen on port XYZ and testing it on localhost.

What I've never completely understood about Node.jd is how you can set it up on a server to function like Apache. I have a URL already pointing to an out-of-the-box Ubuntu Lucid distro. But it's hard to find a tutorial on this. Do I just run the script from the command line on my server and then close the ssh connection? That seems like a horrible way to do it. Do I need to learn how to make the Node script into a service like httpd? Is that hard?

Much appreciated.

Chris Wilson
  • 6,599
  • 8
  • 35
  • 71
  • 2
    what you are looking for is how to create a daemon. check out http://stackoverflow.com/questions/4018154/node-js-as-a-background-service – Doon Sep 16 '13 at 14:21

1 Answers1

0

You will need to create an init script for this service, try this: https://gist.github.com/peterhost/715255

-- ab1

ab77
  • 841
  • 12
  • 14