i

Http Modules

To use the Http Server, we have a built-in module http module. This module is designed to support features of the HTTP protocol.

This module helps in creating a server, which is traditionally a tedious task to do.

However, the http module still doesn’t support the full spectrum of possible HTTP applications. It doesn’t handle the parsing of the actual header or body.

In the below example, we created a server using

     http-demo.js

    Console on running node http-demo.js

Our server is created at hostname variable and running at port 3000.

By default, a server is created at localhost

Browser