M
M
moon_and_altair2014-10-15 12:57:45
Node.js
moon_and_altair, 2014-10-15 12:57:45

How to create a site in NodeJs that will work as standard, without the help of ports: 8080, etc.?

I understand NodeJs, namely in creating a simple web application, I do everything according to the manuals, but I see the mandatory writing of "listening" to any port:
http.createServer(onRequest).listen(8888);
And as a result, I have to run domain.ru: 8080 through this port, how to create a site for a normal call like domain.ru?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2014-10-15
@moon_and_altair

http.createServer(onRequest).listen(80);

K
Konstantin Kitmanov, 2014-10-16
@k12th

This is standard practice. The fact is that listening to port 80 requires root privileges on * nix, respectively, only nginx / apache occupies this port, it also proxies requests directly to an application that listens to some 8080 or 8888 or 3000 port.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question