There are a handful of websites out there that will host your node.js server/app for you. But what if I want to deploy it on my own hardware, making it viewable from example.com? How do I do that? Thanks.
This shouldn't make a difference, but just in case, this is the software I'm using: I'm using express.js, node.js, socket.io, and Linux (one of my developers is making an OS specifically for my app, or so he says. We may just use an established distro, but we're still in the planning process).
js application locally after closing the terminal or Application, to run the nodeJS application permanently. We use NPM modules such as forever or PM2 to ensure that a given script runs continuously. NPM is a Default Package manager for Node.
Initiating a server is just part of what NodeJS does. Assuming that you just want to do something functional or scripts, just write a . js file as it is, using NodeJS's libraries, then run it by executing node binary on the file.
There are several ways of hosting node.js projects.
You can hook it up behind nginx or apache, so they would do the static file exchange, but since you want to use websockets, then it shouldnt be good idea.
You can also use just plain node.js and it can be set up in millions of ways based on your needs. Starting with your plain express project just run by node app.js. But most likely you want to use something like forever http://blog.nodejitsu.com/keep-a-nodejs-server-up-with-forever to keep your node instance alive.
I loved cluster.js set up but its outdated.
Some more links with good info:
There are more info out there, your developers will just have to dig and figure out whats best for your project. Also deployment descriptions for Amazon EC2 is pretty much the same as on any hardware you own.
P.S. Also basic stuff: point out your domain to your server ip, run node with port 80, your good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With