How to execute a file in node js.

With a text editor, create a file called web-server.js, with the following contents:

var http = require('http');
var serv = http.createServer(function (req, res) {
    res.writeHead(200, { 'Content-Type': 'text/html' });
    res.end('<marquee>Debug Report</marquee>');
});
serv.listen(3000);

Run the file:

node web-server.js

Comments

Popular posts from this blog

Fatal: LoadModule: error loading module 'mod_sql_mysql.c'

How to hide Android Soft Keyboard