SlideShare a Scribd company logo
1 of 18
Download to read offline
NodeJS
(Runtime Environment + JS Library) Platform
Agenda
➢ What is Node JS?
➢ What is NOT Node JS?
➢ Features of Node JS
➢ Advantages of Node JS
➢ Limitations of Node JS
➢ npm
➢ npm Functionalities
➢ ExpressJS
➢ NodeJS RESTful API
➢ Helloworld Example
➢ References
What is Node JS ?
➢ Node JS is an Open Source JavaScript Platform used to develop fast and scalable
server-side and networking applications very easily.
➢ Google’s V8 Engine is an Open Source JavaScript Engine for the Chrome Web
browser. V8 Engine is completely written in C++ Language.
➢ Ryan Dahl is a big fan of “Google’s Gmail”. He was impressed by Gmail
performance and started created new Platform.
➢ Ryan Dahl has developed a Server-Side Platform “Node JS” in 2009 on top of
Google’s V8 Engine. That means Node JS applications run on V8 Engine.
➢ Unlike some UI Frameworks for example Angular JS, use to write Client-side
JavaScript, Node JS Platform is used to write Server-side JavaScript.
➢ We can run Node JS applications on most of the OS Platforms like Windows, Linux,
Mac etc.
What is NOT Node JS?
➢ Node JS is a Platform. It is not a Framework or Web Framework. It is not a
Language.
➢ It is a Platform which contains thousands of thousands of modules to develop wide
variety of applications. We can install base Node JS Platform and update all your
application required modules very easily.
➢ Node JS “Module” is also known as Package. Now onwards, when we refer Module
means Node JS Package.
➢ Node JS is not for Multi-Threaded applications. It follows Single Thread with Event
Loop architecture.
Features of Node JS
➢ Modularity
➢ Express JS
➢ Non-blocking or Asynchronous IO
➢ Event-Driven Asynchronous Platform
➢ Databases integration
➢ Template engines
➢ Web Server
➢ Better Socket API
Advantages of Node JS
➢ One Language and One Data Format
➢ Open Source
➢ Highly Scalable
➢ Better Performance and Low Latency
➢ Caching Modules
➢ Less Problems with Concurrency
➢ Easy to Extend and Lightweight
➢ Faster Development and Easy to Maintain
➢ REST API
➢ Many Development Frameworks and Tools
➢ Active Development Community
Advantages of Node JS (Cont...)
➢ Unit Testing
➢ Streaming Data
➢ Creating Servers
➢ It can handle thousands of concurrent connections with minimal overhead
(CPU/Memory) on a single process
➢ Easy Module Loading process
Limitations of Node JS
➢ It does NOT support Multi-threading programming.
➢ It does support for Computational Intensive Tasks. Node JS struggles in handling of
very high computational intensive tasks, because whenever it does something long
running task, it will queue all remaining incoming requests, because it follows
Single-Thread Architecture with Event Loop.
➢ Don’t use Node JS for Blocking/Synchronous and CPU-intensive tasks.
npm (Nodejs Package Manager):
npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy
to update the code that you're sharing.
These bits of reusable code are called packages, or sometimes modules. A package is just a
directory with one or more files in it, that also has a file called "package.json" with some
metadata about this package.
A typical application, such as a website, will depend on dozens or hundreds of packages.
These packages are often small. The general idea is that you create a small building block
which solves one problem and solves it well. This makes it possible for you to compose
larger, custom solutions out of these small, shared building blocks.
npm (Node Package Manager) Functionalities
Node Package Manager (npm) provides following two main functionalities:
➢ Online repositories for node.js packages/modules which are searchable on
search.nodejs.org
➢ Command line utility to install Node.js packages, do version management and
dependency management of Node.js packages.
➢ NPM comes bundled with Node.js installables after v0.6.3 version. To verify the
same, open console and type following command and see the result:
➢ $npm --version
ExpressJS
Express is a minimal and flexible Node.js web application framework that provides a
robust set of features for web and mobile applications.
Following are the features of ExpressJS:
➢ Expressjs is a nodejs framework for parsing the payload, handling cookies.
➢ Express.js has memory storage for sessions and can also be used with Redis
➢ Can be used to load server static files
➢ Expressjs provides routing to implement and handle Rest services.
➢ provides middleware to routing which can be used for protecting api calls.
➢ Uses default template engines (Jade, haml) for views rendering.
➢ Start and Create server connections with nodeJS.
NodeJS RESTful API
Nodejs can support the restful api development. Many web applications can build by the
node modules.
Some of the following modules helps to RESTful API:
Http: Used to invoke all rest methods (GET, POST, PUT, DELETE, OPTIONS)
Express: Web framework
Require : Used to load the modules and callbacks
Hello world example
➢ Step 1: First create a directory named myapp, change to it and run npm init. Then install express as a
dependency, as per the installation guide. In the myapp directory, create a file named app.js and add the
following code:
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
➢ Step 2: Run the app with the following command: $ node app.js
➢ Step 3: Load http://localhost:3000/ in a browser to see the output.
Technologies used with NodeJS
NodeJS Usage Chart
References
➢ https://nodejs.org/en/
➢ https://expressjs.com/
➢ https://www.npmjs.com/
➢ https://blog.risingstack.com/what-is-nodejs-used-for-the-2015-nodejs-overview-repor
t/
Thank You

More Related Content

What's hot

What's hot (20)

NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Introduction to Node JS.pdf
Introduction to Node JS.pdfIntroduction to Node JS.pdf
Introduction to Node JS.pdf
 
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...
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Nodejs
NodejsNodejs
Nodejs
 
Node js
Node jsNode js
Node js
 
Node js crash course session 1
Node js crash course   session 1Node js crash course   session 1
Node js crash course session 1
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash Course
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
Node.js
Node.jsNode.js
Node.js
 
Express js
Express jsExpress js
Express js
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
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
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 

Viewers also liked

Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
Dinh Pham
 

Viewers also liked (20)

Building Web Apps & APIs With Node JS
Building Web Apps & APIs With Node JSBuilding Web Apps & APIs With Node JS
Building Web Apps & APIs With Node JS
 
Testing NodeJS Security
Testing NodeJS SecurityTesting NodeJS Security
Testing NodeJS Security
 
Understanding WebRTC - Infographic
Understanding WebRTC - Infographic Understanding WebRTC - Infographic
Understanding WebRTC - Infographic
 
Nodejs getting started
Nodejs getting startedNodejs getting started
Nodejs getting started
 
Web Development with Node.js
Web Development with Node.jsWeb Development with Node.js
Web Development with Node.js
 
NodeMN: Building AI into your Node.js apps
NodeMN: Building AI into your Node.js appsNodeMN: Building AI into your Node.js apps
NodeMN: Building AI into your Node.js apps
 
Kranky Geek Sao Paulo 2016 - WebRTC Statistics and Analytics
Kranky Geek Sao Paulo 2016 - WebRTC Statistics and AnalyticsKranky Geek Sao Paulo 2016 - WebRTC Statistics and Analytics
Kranky Geek Sao Paulo 2016 - WebRTC Statistics and Analytics
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
 
Node JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppNode JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web App
 
Nodejs in Production
Nodejs in ProductionNodejs in Production
Nodejs in Production
 
Node JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web AppNode JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web App
 
NodeJS security - still unsafe at most speeds - v1.0
NodeJS security - still unsafe at most speeds - v1.0NodeJS security - still unsafe at most speeds - v1.0
NodeJS security - still unsafe at most speeds - v1.0
 
Node Architecture Implications for In-Memory Data Analytics on Scale-in Clusters
Node Architecture Implications for In-Memory Data Analytics on Scale-in ClustersNode Architecture Implications for In-Memory Data Analytics on Scale-in Clusters
Node Architecture Implications for In-Memory Data Analytics on Scale-in Clusters
 
Node js
Node jsNode js
Node js
 
The Digital Marketing Guide E-Book
The Digital Marketing Guide E-BookThe Digital Marketing Guide E-Book
The Digital Marketing Guide E-Book
 
PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
 
Build a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.jsBuild a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.js
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
 
Modern UI Development With Node.js
Modern UI Development With Node.jsModern UI Development With Node.js
Modern UI Development With Node.js
 
Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907
 

Similar to Node js (runtime environment + js library) platform

Node.js.pdf
Node.js.pdfNode.js.pdf
Node.js.pdf
gulfam ali
 
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
 

Similar to Node js (runtime environment + js library) platform (20)

Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
 
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
 
Node.js.pdf
Node.js.pdfNode.js.pdf
Node.js.pdf
 
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
 
Introduction to NodeJS JSX is an extended Javascript based language used by R...
Introduction to NodeJS JSX is an extended Javascript based language used by R...Introduction to NodeJS JSX is an extended Javascript based language used by R...
Introduction to NodeJS JSX is an extended Javascript based language used by R...
 
Mastering node.js, part 1 - introduction
Mastering node.js, part 1 - introductionMastering node.js, part 1 - introduction
Mastering node.js, part 1 - introduction
 
An Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureAn Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows Azure
 
Nodejs
NodejsNodejs
Nodejs
 
Nodejs
NodejsNodejs
Nodejs
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applications
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
Understanding Node.js and Django.docx
Understanding Node.js and Django.docxUnderstanding Node.js and Django.docx
Understanding Node.js and Django.docx
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptx
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
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
 
All You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdfAll You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdf
 
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
 
Treinamento frontend
Treinamento frontendTreinamento frontend
Treinamento frontend
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
 

Recently uploaded

ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
Madan Karki
 

Recently uploaded (20)

Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
 
15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon
 
E-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are presentE-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are present
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
The battle for RAG, explore the pros and cons of using KnowledgeGraphs and Ve...
 
Electrical shop management system project report.pdf
Electrical shop management system project report.pdfElectrical shop management system project report.pdf
Electrical shop management system project report.pdf
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdf
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Geometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdfGeometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdf
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
 
Multivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptxMultivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptx
 
ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdf
 
Introduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and ApplicationsIntroduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and Applications
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdf
 
Artificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian ReasoningArtificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian Reasoning
 
EMPLOYEE MANAGEMENT SYSTEM FINAL presentation
EMPLOYEE MANAGEMENT SYSTEM FINAL presentationEMPLOYEE MANAGEMENT SYSTEM FINAL presentation
EMPLOYEE MANAGEMENT SYSTEM FINAL presentation
 
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdfBURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
 

Node js (runtime environment + js library) platform

  • 1. NodeJS (Runtime Environment + JS Library) Platform
  • 2. Agenda ➢ What is Node JS? ➢ What is NOT Node JS? ➢ Features of Node JS ➢ Advantages of Node JS ➢ Limitations of Node JS ➢ npm ➢ npm Functionalities ➢ ExpressJS ➢ NodeJS RESTful API ➢ Helloworld Example ➢ References
  • 3. What is Node JS ? ➢ Node JS is an Open Source JavaScript Platform used to develop fast and scalable server-side and networking applications very easily. ➢ Google’s V8 Engine is an Open Source JavaScript Engine for the Chrome Web browser. V8 Engine is completely written in C++ Language. ➢ Ryan Dahl is a big fan of “Google’s Gmail”. He was impressed by Gmail performance and started created new Platform. ➢ Ryan Dahl has developed a Server-Side Platform “Node JS” in 2009 on top of Google’s V8 Engine. That means Node JS applications run on V8 Engine. ➢ Unlike some UI Frameworks for example Angular JS, use to write Client-side JavaScript, Node JS Platform is used to write Server-side JavaScript. ➢ We can run Node JS applications on most of the OS Platforms like Windows, Linux, Mac etc.
  • 4.
  • 5. What is NOT Node JS? ➢ Node JS is a Platform. It is not a Framework or Web Framework. It is not a Language. ➢ It is a Platform which contains thousands of thousands of modules to develop wide variety of applications. We can install base Node JS Platform and update all your application required modules very easily. ➢ Node JS “Module” is also known as Package. Now onwards, when we refer Module means Node JS Package. ➢ Node JS is not for Multi-Threaded applications. It follows Single Thread with Event Loop architecture.
  • 6. Features of Node JS ➢ Modularity ➢ Express JS ➢ Non-blocking or Asynchronous IO ➢ Event-Driven Asynchronous Platform ➢ Databases integration ➢ Template engines ➢ Web Server ➢ Better Socket API
  • 7. Advantages of Node JS ➢ One Language and One Data Format ➢ Open Source ➢ Highly Scalable ➢ Better Performance and Low Latency ➢ Caching Modules ➢ Less Problems with Concurrency ➢ Easy to Extend and Lightweight ➢ Faster Development and Easy to Maintain ➢ REST API ➢ Many Development Frameworks and Tools ➢ Active Development Community
  • 8. Advantages of Node JS (Cont...) ➢ Unit Testing ➢ Streaming Data ➢ Creating Servers ➢ It can handle thousands of concurrent connections with minimal overhead (CPU/Memory) on a single process ➢ Easy Module Loading process
  • 9. Limitations of Node JS ➢ It does NOT support Multi-threading programming. ➢ It does support for Computational Intensive Tasks. Node JS struggles in handling of very high computational intensive tasks, because whenever it does something long running task, it will queue all remaining incoming requests, because it follows Single-Thread Architecture with Event Loop. ➢ Don’t use Node JS for Blocking/Synchronous and CPU-intensive tasks.
  • 10. npm (Nodejs Package Manager): npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update the code that you're sharing. These bits of reusable code are called packages, or sometimes modules. A package is just a directory with one or more files in it, that also has a file called "package.json" with some metadata about this package. A typical application, such as a website, will depend on dozens or hundreds of packages. These packages are often small. The general idea is that you create a small building block which solves one problem and solves it well. This makes it possible for you to compose larger, custom solutions out of these small, shared building blocks.
  • 11. npm (Node Package Manager) Functionalities Node Package Manager (npm) provides following two main functionalities: ➢ Online repositories for node.js packages/modules which are searchable on search.nodejs.org ➢ Command line utility to install Node.js packages, do version management and dependency management of Node.js packages. ➢ NPM comes bundled with Node.js installables after v0.6.3 version. To verify the same, open console and type following command and see the result: ➢ $npm --version
  • 12. ExpressJS Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. Following are the features of ExpressJS: ➢ Expressjs is a nodejs framework for parsing the payload, handling cookies. ➢ Express.js has memory storage for sessions and can also be used with Redis ➢ Can be used to load server static files ➢ Expressjs provides routing to implement and handle Rest services. ➢ provides middleware to routing which can be used for protecting api calls. ➢ Uses default template engines (Jade, haml) for views rendering. ➢ Start and Create server connections with nodeJS.
  • 13. NodeJS RESTful API Nodejs can support the restful api development. Many web applications can build by the node modules. Some of the following modules helps to RESTful API: Http: Used to invoke all rest methods (GET, POST, PUT, DELETE, OPTIONS) Express: Web framework Require : Used to load the modules and callbacks
  • 14. Hello world example ➢ Step 1: First create a directory named myapp, change to it and run npm init. Then install express as a dependency, as per the installation guide. In the myapp directory, create a file named app.js and add the following code: var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('Hello World!'); }); app.listen(3000, function () { console.log('Example app listening on port 3000!'); }); ➢ Step 2: Run the app with the following command: $ node app.js ➢ Step 3: Load http://localhost:3000/ in a browser to see the output.
  • 17. References ➢ https://nodejs.org/en/ ➢ https://expressjs.com/ ➢ https://www.npmjs.com/ ➢ https://blog.risingstack.com/what-is-nodejs-used-for-the-2015-nodejs-overview-repor t/