N
N
narem2019-08-27 15:16:07
Node.js
narem, 2019-08-27 15:16:07

How to make a node server without a port?

Now, in order to go to the page with the script, you need to go to the address:port, can you do it without a port, what would it go like to a regular site?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Adel Khalitov, 2019-08-27
@adelkhalitov

"Normal sites" is some.ru:80, except that the browser omits the :80 port and you see just some.ru.
When you start the node server, it spins on the local host, conditionally port 3000.
When developing, you want to see what happens there, go to localhost:3000.
To broadcast this result to the Internet in the public domain, you need to forward the port.
Either make port 3000 accessible from outside, or bind the domain and redirect from
some.ru(some.ru:80) domain to localhost:3000 using apache or nginx.

D
Daria Motorina, 2019-08-27
@glaphire

This stackoverflow answer will help you. We need to change the configs so that node.js listens to port 80

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question