Node.js comes bundled with an http and an https module. These modules have functions to create an HTTP server so that a Node.js program can respond to HTTP requests. They can also make HTTP requests to other servers.
To Set up HTTP:
1. First, we install the HTTP module.
$ node -v
$ npm init -y
2. We initiate a new Node.js application.
$ npm i http
3. We install HTTP with npm i http command.