Setting Up Your First Node.js Application Step-by-Step

Introduction :-
Download Node.js :-
Visit the Node.js official website and Download the Version compatible to you .
Check on terminal :-
Run this command on terminal
node -v
If it gives you the version of the node.js then it is perfectly fine if not then their is some problem in you node.js setup .
Understanding Node REPL :-
The term get breakdown into four stages of the e interactive loop:-
R-Read :- Your terminal is ready for reading the Java-Script cod e that you write.
E-Eval:- Node parser parse your code and check logic and computes the result .
P-Print:-Node Outputs the evaluated answer on the screen.
L-Loop:-It will return to step one for taking the input again .until Ctrl + C or .exit
How to setup your node REPL :-
By running the node command without any script will run the or without any of the argument would let you to a REPL session .
Creating first JS file :-
Make a new file with the extension .js will let you to a JS file in which you could write your js code.
Running script using node command
Running script using node command can be easily done after opening the command prompt and go the exact folder in which you write your js file then
node <filename> // If file name is script.js
node script.js
Creating server Print "Hello World"
const http=require("http")
const server=http.createserver((req,res)=>{
console.log("Hello world")
}
)
server.listen(PORT,()=>{
console.log("PORT is working on the 8000");
})


