FSD-I NodeJS(slip14,
Slip14: Create a Simple Web Server using node js.
var http=require('http');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/html'});
res.write('Hello world!');
res.end();
}).listen(3010,()=>{
console.log('Active port 3010');
});
Slip13 Create a Node.js file that will convert the output "HELLO WORLD!" into lower-case letters.
var http= require('http');
http.createServer(function (req, res) {
var str = "Hello World";
res.write(str.toLowerCase());
res.end();
}).listen(8089, function () {
console.log('port 8089 is started');
});
Comments
Post a Comment