Nodejs first program - Web Development

Nodejs first program

To run nodejs in your localhost you must have to download nodejs from nodejs site /  . You can perform nodejs codes in notepad++. Now copy this code and paste in notepad++ & how to run this code I will tell you.This first application name is myfile.js

Now go to C Drive and open users folders and save this code inside your name folder (What is your computer user name):- C:\users\dheeraj\myfirst.js Now as you can see here dheeraj is my computer name.

Now open command prompt from the same folder where you have saved this file using shift + right click Or See this image

Nodejs run project

just type node myfile.js  & hit enter button this command will start your local server and go to browser type: http://localhost:8000 It will give this output.

Nodejs program

You can change port name from here }).listen(8000);  Always give free port which is not in use .

Leave a Reply

Your email address will not be published. Required fields are marked *