I
I
Ivan Manoil2015-03-05 11:18:29
JavaScript
Ivan Manoil, 2015-03-05 11:18:29

Server on Node.js?

Hello everyone, help a newbie to understand.
There is a VPS installed Debian and Node.js on it. How to raise a full-fledged web server on Node.js, as I understand it, you need to install http-server. Tell me what steps you need to take to make it work, the task of such a server will be to host websites, the backend of which will be written in Js, and a node application.
Please help anyone understand.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
Timur Shemsedinov, 2015-03-06
@ionmnl

With node.js it's the other way around, it has the web server "inside" the applications, not the applications "inside" the web server. Each application is itself a web server. To make virtual hosts, host many sites, handle many domains, you need to run many node instances and link this whole zoo into one bundle through nginx. If each application assumes a decent load, then each one needs to be parallelized using clusterand then these clusters are already combined through nginx. As a result, if you have 20 sites on a machine, then these are at least 20 node processes, or even all 100. There is an alternative solution - an application server that turns the world back on its head, i.e. there are many applications on the model "inside" the application server: habrahabr.ru/post/247543

A
Andrey Burov, 2015-03-05
@BuriK666

nodejs.org/api/synopsis.html
nodejs.org/api/http.html#http_class_http_server
It's better to proxy all this through nginx.

N
Nook Scheel, 2015-03-12
@inook

Start using Docker+Dokku, install the haproxy or nginx balancer there. Everything works almost out of the box.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question