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
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
Post a Comment