I registered a simple domain name for testing on the dot.tk site.
Let it be called mysite.tk.
I have an application under node.js for simplicity like "Hello World!"
var express = require('express');
var app = express()
var server = require('http').createServer(app);
app.get('/', function(req, res) {
res.send('Hello World!')
});
server.listen(3000, function () {
console.log('Port 3000!')
});
On the local server, everything works. That is, on localhost: 3000 one shows "Hello World".
Question: how do I bind my new mysite.tk domain and my server on the computer?
I know that by default when mapping a domain name to an IP address, all traffic should come to port 80. I do not know, maybe this is the problem. I just use another port 3000 here. Maybe I sould run a proxy server written in node.js that will forward traffic correctly? But how it make?
This solution How to assign a domain name to node.js server? I don't understand enough. It did't help me.