How to Start with NodeJs (Part -2)

JS Developers
1 min readMay 3, 2020
Photo by Karl Pawlowicz on Unsplash

In the first part, we see how we can start with Nodejs, and know to write local server using ExpressJs and start.

As previously we used ExpressJS, here we create Http server with node js without using any framework.

Just follow the installation process from Part One if you have not installed a node yet.

Step 1

Create a directory and open it into a terminal, and using npm init create package.json file.

install Http by the following command

npm install http

Create a file name app.js and write the following

Now in terminal type following and you will get the message in terminal written in console.log

node app.js

open browser and type http://localhost:3001/ in search bar and you will get the message in the display window written in res.end.

if you have any doubt or query please reach out to me

Git- github.com/sachin9663

Linkedin- https://www.linkedin.com/in/sachinkumar9663

--

--