Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js deployment questions

Ive been given the task of localising a facebook app that is built in Node.js that am told uses Nginx for SSL.

This is my first foray into the world of Node.js and I have hit a wall in understanding the deployment process involved in pushing an node app to the world wide web (in order to access it through facebook).

I have a background in front-end development with javascript, AJAX, html and css. As well as backend PHP, and MYSQL. The task of localising the content I'm not worried about as it is only a matter of swapping out a couple of images. Its my core understanding of how the node.js puzzle fits together where it falls down. Not to metion how Nginx even fits in.

I have done alot of searching online and found a lot of beginners tutorials eg http://www.nodebeginner.org/ which is fine but doesn't touch on how node web apps are deployed. I can build the simple hello world example locally but how does this become a "proper www.website". There are also a tonne of other resources out there but they presume a more advanced level of understanding and technical know-how. I just need it in layman's terms.

I get that Node.js is server-side javascript so this obviously means it lives on a server right? i currently have a domain, website and hosting plan can i use this server? i access it through a cpanel or ftp. Or do i have to create a new server from scratch? Maybe a virtual server maybe using https://www.virtualbox.org/ what would be this involve?

any help you guy may be able to give me is much appreciated.

cheers

like image 308
pixelgiantnz Avatar asked Nov 13 '22 16:11

pixelgiantnz


1 Answers

So, you probably won't be able to use Node.js on a typical 'hosted server'. These servers are typically running Apache and only support a limited set of languages. There are several providers that offer Node.JS hosting, including the creators: Joyent.

Otherwise, you'll need control of the actual server so that you can run the node myapp.js command. For a list of possible providers, see here.

Once you get the app running node myapp.js, it should start handling incoming web requests, just like any other web server. Now, if someone is using nginx, they're probably using it as a load-balancer or to serve static content.

If you don't understand how or why it's configured this way, you definitely need to talk to the project owners. The rest of the details depend completely on where / how you're hosting and the answers to the nginx questions.

like image 92
Gates VP Avatar answered Nov 16 '22 17:11

Gates VP