Binding a Single Domain to a VPS Server on NodeJS
Let's try the simplest way to bind a domain to a server. This method will work if you will have only one domain on your server.
For this method, you need to run
the test site script on port 80:
app.listen(80, function() {
console.log('running');
});
The site running on this port will be accessible only by IP address, without specifying a port:
http://12.345.678.90
Next, you need to have a domain
or subdomain purchased from a registrar.
In the domain registrar's panel,
go to the Domains section,
look for Zone Management there,
and there find our domain (or subdomain)
and change its A-record to the IP
of our server.
Wait a few minutes (no more than 10)
and then try to visit the
domain name. If everything is done
correctly, we should see the result
of the test script's work.
Bind a domain to your test site.