際際滷

際際滷Share a Scribd company logo
NODE JS
YAUHENI NIKANOVICH
package ecosystem, npm, is the
largest ecosystem of open source
libraries in the world.
is a JavaScript runtime built
on Chrome's V8 JavaScript
engine.
uses an event-driven, non-blocking I/O
model that makes it lightweight and
ef鍖cient.
allows the creation of Web
servers and networking tools
using JavaScript
is the JavaScript execution engine built for Google Chrome
and open-sourced by Google in 2008. Written in C++, V8
compiles JavaScript source code to native machine code
instead of interpreting it in real time.
is a package manager for the JavaScript programming language.
It is the default package manager for the JavaScript runtime
environment NodeJS
It consists of a command line client, also called npm, and an
online database of public packages, called the npm registry
The registry is accessed via the client, and the available packages
can be browsed and searched via the npm website
All APIs of NodeJS library are asynchronous, that is, non-
blocking.
It essentially means a NodeJS based server never waits for an
API to return data.
The server moves to the next API after calling it and a
noti鍖cation mechanism of Events of NodeJS helps the server
to get a response from the previous API call.
NodeJS allows to create a scalable and fast web server in
simple way by using JavaScript.
Opportunity to write client-side and server-side parts of web
application on your favourite JavaScript sounds appealing!
We will need:
 Knowledge of the basics JavaScript language
 Installed NodeJS (https://nodejs.org)
 Any text redactor / IDE
 Terminal
LET'S MAKE A SIMPLE SERVER WITH NODEJS (1/5)
Preparation:
 Create project folder
 Add server.js to project folder
 Install node-router package via npm
LET'S MAKE A SIMPLE SERVER WITH NODEJS (2/5)
 Add some code
{
LET'S MAKE A SIMPLE SERVER WITH NODEJS (2/5)
 Run our server.js
LET'S MAKE A SIMPLE SERVER WITH NODEJS (3/5)
LET'S MAKE A SIMPLE SERVER WITH NODEJS (4/5)
 And check the result in browser
As we can see at network tab, when we call origin.
Browser automatically send GET request to ORIGIN.
According the code if someone sent a request for origin then
NodeJS send back a response with text "Hello!"
Looks 鍖ne and easy, isn't it?
YAUHENI NIKANOVICH
Thanks
EMAIL: zhenyanikon@gmail.com
2016

More Related Content

What's hot (20)

Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash Course
Haim Michael
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Winston Hsieh
Node js
Node jsNode js
Node js
umesh patil
Node js - Enterprise Class
Node js - Enterprise ClassNode js - Enterprise Class
Node js - Enterprise Class
Glenn Block
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.js
Yoann Gotthilf
NodeJS
NodeJSNodeJS
NodeJS
Alok Guha
Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorial
Katy Slemon
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vadym Lotar
Node Session - 1
Node Session - 1Node Session - 1
Node Session - 1
Bhavin Shah
Nodejs
NodejsNodejs
Nodejs
Akhil Gopan
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Edureka!
Starting with Node.js
Starting with Node.jsStarting with Node.js
Starting with Node.js
Jitendra Zaa
Node intro
Node introNode intro
Node intro
Vishal Sharma
Future-proof Development for Classic SharePoint
Future-proof Development for Classic SharePointFuture-proof Development for Classic SharePoint
Future-proof Development for Classic SharePoint
Bob German
Simple hack: use multiple mongodb databases in a nodejs express mongodb appli...
Simple hack: use multiple mongodb databases in a nodejs express mongodb appli...Simple hack: use multiple mongodb databases in a nodejs express mongodb appli...
Simple hack: use multiple mongodb databases in a nodejs express mongodb appli...
Manoj Mohanan
Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
Parth Joshi
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js Platform
Naresh Chintalcheru
MongoDB Israel June Meetup
MongoDB Israel June MeetupMongoDB Israel June Meetup
MongoDB Israel June Meetup
Valeri Karpov
Introduction to node
Introduction to nodeIntroduction to node
Introduction to node
girish82
MongoDB on Windows Azure
MongoDB on Windows AzureMongoDB on Windows Azure
MongoDB on Windows Azure
MongoDB
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash Course
Haim Michael
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Winston Hsieh
Node js - Enterprise Class
Node js - Enterprise ClassNode js - Enterprise Class
Node js - Enterprise Class
Glenn Block
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.js
Yoann Gotthilf
Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorial
Katy Slemon
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vadym Lotar
Node Session - 1
Node Session - 1Node Session - 1
Node Session - 1
Bhavin Shah
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Edureka!
Starting with Node.js
Starting with Node.jsStarting with Node.js
Starting with Node.js
Jitendra Zaa
Future-proof Development for Classic SharePoint
Future-proof Development for Classic SharePointFuture-proof Development for Classic SharePoint
Future-proof Development for Classic SharePoint
Bob German
Simple hack: use multiple mongodb databases in a nodejs express mongodb appli...
Simple hack: use multiple mongodb databases in a nodejs express mongodb appli...Simple hack: use multiple mongodb databases in a nodejs express mongodb appli...
Simple hack: use multiple mongodb databases in a nodejs express mongodb appli...
Manoj Mohanan
Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
Parth Joshi
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js Platform
Naresh Chintalcheru
MongoDB Israel June Meetup
MongoDB Israel June MeetupMongoDB Israel June Meetup
MongoDB Israel June Meetup
Valeri Karpov
Introduction to node
Introduction to nodeIntroduction to node
Introduction to node
girish82
MongoDB on Windows Azure
MongoDB on Windows AzureMongoDB on Windows Azure
MongoDB on Windows Azure
MongoDB

Similar to Node js first look - 2016 (20)

Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
PSK Technolgies Pvt. Ltd. IT Company Nagpur
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
PSK Technolgies Pvt. Ltd. IT Company Nagpur
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sails
Brian Shannon
Nodejs
NodejsNodejs
Nodejs
Bhushan Patil
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
Kalp Corporate
Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
sanskriti agarwal
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed Assaf
Ahmed Assaf
Nodejs
NodejsNodejs
Nodejs
Vinod Kumar Marupu
Nodejs
NodejsNodejs
Nodejs
dssprakash
Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10
David Ashton
Proposal
ProposalProposal
Proposal
Constantine Priemski
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platform
Sreenivas Kappala
Steps to Install NPM and Node.js on Windows and MAC
Steps to Install NPM and Node.js on Windows and MACSteps to Install NPM and Node.js on Windows and MAC
Steps to Install NPM and Node.js on Windows and MAC
Inexture Solutions
Node.js.pdf
Node.js.pdfNode.js.pdf
Node.js.pdf
gulfam ali
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
leffen
concept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJSconcept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJS
Kongu Engineering College, Perundurai, Erode
How to Install Node.js and NPM on Windows and Mac?
How to Install Node.js and NPM on Windows and Mac?How to Install Node.js and NPM on Windows and Mac?
How to Install Node.js and NPM on Windows and Mac?
Inexture Solutions
Node
NodeNode
Node
Manav Prasad
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
DarshanaMallick
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
Ahmed Elbassel
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sails
Brian Shannon
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
Kalp Corporate
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed Assaf
Ahmed Assaf
Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10
David Ashton
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platform
Sreenivas Kappala
Steps to Install NPM and Node.js on Windows and MAC
Steps to Install NPM and Node.js on Windows and MACSteps to Install NPM and Node.js on Windows and MAC
Steps to Install NPM and Node.js on Windows and MAC
Inexture Solutions
Node.js.pdf
Node.js.pdfNode.js.pdf
Node.js.pdf
gulfam ali
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
leffen
How to Install Node.js and NPM on Windows and Mac?
How to Install Node.js and NPM on Windows and Mac?How to Install Node.js and NPM on Windows and Mac?
How to Install Node.js and NPM on Windows and Mac?
Inexture Solutions
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
DarshanaMallick
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
Ahmed Elbassel

Recently uploaded (20)

renal, diabetes.pdf........................
renal, diabetes.pdf........................renal, diabetes.pdf........................
renal, diabetes.pdf........................
jhonszaynjhonszayn
Chapter 6-firewalls-whitman-information security.ppt
Chapter 6-firewalls-whitman-information security.pptChapter 6-firewalls-whitman-information security.ppt
Chapter 6-firewalls-whitman-information security.ppt
ayeshabatool947681
Byzantine Empire.pdf, history and geography yes yes yes
Byzantine Empire.pdf, history and geography yes yes yesByzantine Empire.pdf, history and geography yes yes yes
Byzantine Empire.pdf, history and geography yes yes yes
estuchedetumadre
Franchise Growth Playbook: Scale Smarter with StalkusDigital
Franchise Growth Playbook: Scale Smarter with StalkusDigitalFranchise Growth Playbook: Scale Smarter with StalkusDigital
Franchise Growth Playbook: Scale Smarter with StalkusDigital
stalkus digital
Amazon Sidewalk: A Global Wake-Up Call for the Telecom Industry
Amazon Sidewalk: A Global Wake-Up Call for the Telecom IndustryAmazon Sidewalk: A Global Wake-Up Call for the Telecom Industry
Amazon Sidewalk: A Global Wake-Up Call for the Telecom Industry
David Swift
Frontier Internet Availability Expanding Access to Rural Communities.pdf
Frontier Internet Availability Expanding Access to Rural Communities.pdfFrontier Internet Availability Expanding Access to Rural Communities.pdf
Frontier Internet Availability Expanding Access to Rural Communities.pdf
Internet Bundle Now
Mastering SEO: Build a Winning Strategy from the Ground Up
Mastering SEO: Build a Winning Strategy from the Ground UpMastering SEO: Build a Winning Strategy from the Ground Up
Mastering SEO: Build a Winning Strategy from the Ground Up
thedigicenter
SOAR Security Systems: Revolutionizing Cybersecurity Through Orchestration an...
SOAR Security Systems: Revolutionizing Cybersecurity Through Orchestration an...SOAR Security Systems: Revolutionizing Cybersecurity Through Orchestration an...
SOAR Security Systems: Revolutionizing Cybersecurity Through Orchestration an...
ElSayedSanad1
What is Satellite Communication and How Does it Work.pdf
What is Satellite Communication and How Does it Work.pdfWhat is Satellite Communication and How Does it Work.pdf
What is Satellite Communication and How Does it Work.pdf
Telecoms Supermarket
State of Artificial Intelligence Report - 2024 ONLINE.pdf
State of Artificial Intelligence Report - 2024 ONLINE.pdfState of Artificial Intelligence Report - 2024 ONLINE.pdf
State of Artificial Intelligence Report - 2024 ONLINE.pdf
ManuBatra12
download di slideshare ngak bisa padahal udah upload file 2 kali
download di slideshare ngak bisa padahal udah upload file 2 kalidownload di slideshare ngak bisa padahal udah upload file 2 kali
download di slideshare ngak bisa padahal udah upload file 2 kali
haikalmalikpranasta
Copy of Tech Startup by 際際滷sgo....pptx
Copy of Tech Startup by 際際滷sgo....pptxCopy of Tech Startup by 際際滷sgo....pptx
Copy of Tech Startup by 際際滷sgo....pptx
ErdiErdi6
Presale Crypto List: High Risk, High Reward Insights
 Presale Crypto List: High Risk, High Reward Insights Presale Crypto List: High Risk, High Reward Insights
Presale Crypto List: High Risk, High Reward Insights
Coin Gabbar
Mdf Board manufacturer in india.........
Mdf Board manufacturer in india.........Mdf Board manufacturer in india.........
Mdf Board manufacturer in india.........
veerseo13
Cloud Security Services: Protect Data with Cutting-Edge Solutions
Cloud Security Services: Protect Data with Cutting-Edge SolutionsCloud Security Services: Protect Data with Cutting-Edge Solutions
Cloud Security Services: Protect Data with Cutting-Edge Solutions
privaxic
Press Conference Future of Business: Trends and Predictions for 2025
Press Conference Future of Business: Trends and Predictions for 2025Press Conference Future of Business: Trends and Predictions for 2025
Press Conference Future of Business: Trends and Predictions for 2025
SanskarTiwari20
Splunk configuration file for the cloud
Splunk configuration file  for the cloudSplunk configuration file  for the cloud
Splunk configuration file for the cloud
willmorekanan
From the Boardroom to the Terminal_ Adapting to the Future - DevOpsBCN - Apr ...
From the Boardroom to the Terminal_ Adapting to the Future - DevOpsBCN - Apr ...From the Boardroom to the Terminal_ Adapting to the Future - DevOpsBCN - Apr ...
From the Boardroom to the Terminal_ Adapting to the Future - DevOpsBCN - Apr ...
devopsbcnmeetup
INTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY, BY GEMNIC
INTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY, BY GEMNICINTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY, BY GEMNIC
INTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY, BY GEMNIC
gemnicscience
MiniTool Power Data Recovery Crack Latest
MiniTool Power Data Recovery Crack  LatestMiniTool Power Data Recovery Crack  Latest
MiniTool Power Data Recovery Crack Latest
adreeskhan14780
renal, diabetes.pdf........................
renal, diabetes.pdf........................renal, diabetes.pdf........................
renal, diabetes.pdf........................
jhonszaynjhonszayn
Chapter 6-firewalls-whitman-information security.ppt
Chapter 6-firewalls-whitman-information security.pptChapter 6-firewalls-whitman-information security.ppt
Chapter 6-firewalls-whitman-information security.ppt
ayeshabatool947681
Byzantine Empire.pdf, history and geography yes yes yes
Byzantine Empire.pdf, history and geography yes yes yesByzantine Empire.pdf, history and geography yes yes yes
Byzantine Empire.pdf, history and geography yes yes yes
estuchedetumadre
Franchise Growth Playbook: Scale Smarter with StalkusDigital
Franchise Growth Playbook: Scale Smarter with StalkusDigitalFranchise Growth Playbook: Scale Smarter with StalkusDigital
Franchise Growth Playbook: Scale Smarter with StalkusDigital
stalkus digital
Amazon Sidewalk: A Global Wake-Up Call for the Telecom Industry
Amazon Sidewalk: A Global Wake-Up Call for the Telecom IndustryAmazon Sidewalk: A Global Wake-Up Call for the Telecom Industry
Amazon Sidewalk: A Global Wake-Up Call for the Telecom Industry
David Swift
Frontier Internet Availability Expanding Access to Rural Communities.pdf
Frontier Internet Availability Expanding Access to Rural Communities.pdfFrontier Internet Availability Expanding Access to Rural Communities.pdf
Frontier Internet Availability Expanding Access to Rural Communities.pdf
Internet Bundle Now
Mastering SEO: Build a Winning Strategy from the Ground Up
Mastering SEO: Build a Winning Strategy from the Ground UpMastering SEO: Build a Winning Strategy from the Ground Up
Mastering SEO: Build a Winning Strategy from the Ground Up
thedigicenter
SOAR Security Systems: Revolutionizing Cybersecurity Through Orchestration an...
SOAR Security Systems: Revolutionizing Cybersecurity Through Orchestration an...SOAR Security Systems: Revolutionizing Cybersecurity Through Orchestration an...
SOAR Security Systems: Revolutionizing Cybersecurity Through Orchestration an...
ElSayedSanad1
What is Satellite Communication and How Does it Work.pdf
What is Satellite Communication and How Does it Work.pdfWhat is Satellite Communication and How Does it Work.pdf
What is Satellite Communication and How Does it Work.pdf
Telecoms Supermarket
State of Artificial Intelligence Report - 2024 ONLINE.pdf
State of Artificial Intelligence Report - 2024 ONLINE.pdfState of Artificial Intelligence Report - 2024 ONLINE.pdf
State of Artificial Intelligence Report - 2024 ONLINE.pdf
ManuBatra12
download di slideshare ngak bisa padahal udah upload file 2 kali
download di slideshare ngak bisa padahal udah upload file 2 kalidownload di slideshare ngak bisa padahal udah upload file 2 kali
download di slideshare ngak bisa padahal udah upload file 2 kali
haikalmalikpranasta
Copy of Tech Startup by 際際滷sgo....pptx
Copy of Tech Startup by 際際滷sgo....pptxCopy of Tech Startup by 際際滷sgo....pptx
Copy of Tech Startup by 際際滷sgo....pptx
ErdiErdi6
Presale Crypto List: High Risk, High Reward Insights
 Presale Crypto List: High Risk, High Reward Insights Presale Crypto List: High Risk, High Reward Insights
Presale Crypto List: High Risk, High Reward Insights
Coin Gabbar
Mdf Board manufacturer in india.........
Mdf Board manufacturer in india.........Mdf Board manufacturer in india.........
Mdf Board manufacturer in india.........
veerseo13
Cloud Security Services: Protect Data with Cutting-Edge Solutions
Cloud Security Services: Protect Data with Cutting-Edge SolutionsCloud Security Services: Protect Data with Cutting-Edge Solutions
Cloud Security Services: Protect Data with Cutting-Edge Solutions
privaxic
Press Conference Future of Business: Trends and Predictions for 2025
Press Conference Future of Business: Trends and Predictions for 2025Press Conference Future of Business: Trends and Predictions for 2025
Press Conference Future of Business: Trends and Predictions for 2025
SanskarTiwari20
Splunk configuration file for the cloud
Splunk configuration file  for the cloudSplunk configuration file  for the cloud
Splunk configuration file for the cloud
willmorekanan
From the Boardroom to the Terminal_ Adapting to the Future - DevOpsBCN - Apr ...
From the Boardroom to the Terminal_ Adapting to the Future - DevOpsBCN - Apr ...From the Boardroom to the Terminal_ Adapting to the Future - DevOpsBCN - Apr ...
From the Boardroom to the Terminal_ Adapting to the Future - DevOpsBCN - Apr ...
devopsbcnmeetup
INTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY, BY GEMNIC
INTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY, BY GEMNICINTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY, BY GEMNIC
INTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY, BY GEMNIC
gemnicscience
MiniTool Power Data Recovery Crack Latest
MiniTool Power Data Recovery Crack  LatestMiniTool Power Data Recovery Crack  Latest
MiniTool Power Data Recovery Crack Latest
adreeskhan14780

Node js first look - 2016

  • 2. package ecosystem, npm, is the largest ecosystem of open source libraries in the world. is a JavaScript runtime built on Chrome's V8 JavaScript engine. uses an event-driven, non-blocking I/O model that makes it lightweight and ef鍖cient. allows the creation of Web servers and networking tools using JavaScript
  • 3. is the JavaScript execution engine built for Google Chrome and open-sourced by Google in 2008. Written in C++, V8 compiles JavaScript source code to native machine code instead of interpreting it in real time.
  • 4. is a package manager for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment NodeJS It consists of a command line client, also called npm, and an online database of public packages, called the npm registry The registry is accessed via the client, and the available packages can be browsed and searched via the npm website
  • 5. All APIs of NodeJS library are asynchronous, that is, non- blocking. It essentially means a NodeJS based server never waits for an API to return data. The server moves to the next API after calling it and a noti鍖cation mechanism of Events of NodeJS helps the server to get a response from the previous API call.
  • 6. NodeJS allows to create a scalable and fast web server in simple way by using JavaScript. Opportunity to write client-side and server-side parts of web application on your favourite JavaScript sounds appealing!
  • 7. We will need: Knowledge of the basics JavaScript language Installed NodeJS (https://nodejs.org) Any text redactor / IDE Terminal LET'S MAKE A SIMPLE SERVER WITH NODEJS (1/5)
  • 8. Preparation: Create project folder Add server.js to project folder Install node-router package via npm LET'S MAKE A SIMPLE SERVER WITH NODEJS (2/5)
  • 9. Add some code { LET'S MAKE A SIMPLE SERVER WITH NODEJS (2/5)
  • 10. Run our server.js LET'S MAKE A SIMPLE SERVER WITH NODEJS (3/5)
  • 11. LET'S MAKE A SIMPLE SERVER WITH NODEJS (4/5) And check the result in browser
  • 12. As we can see at network tab, when we call origin. Browser automatically send GET request to ORIGIN. According the code if someone sent a request for origin then NodeJS send back a response with text "Hello!" Looks 鍖ne and easy, isn't it?