Create server

The following code creates a server and assign a port.

var http = require('http');

http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Your node server is running');
}).listen(8282);

Simply run the code and open http://localhost:8282 in your browser.