Header Ads Widget

BCA Information

Slip1

  Slip no 1-

Q1.create node js file that will convert output hello world into upper case letter.

demo_uppercase.js

var http = require('http');  // includes the http module

var uc = require('upper-case'); // include the upper-case module

http.createServer(function (req, res) {

    res.writeHead(200, {'Content-Type': 'text/html'});

    res.write(uc. upper case("hello world!")); // assign the upper-case module

    res.end();

}).listen(8080); // port number


Run program

C:\Users\Your Name>node demo_uppercase.js
Finally, open your browser and navigate to http://localhost:8080





Post a Comment

0 Comments

Popular Posts

Visual Basic 6.0 Program
Node js practical