SlideShare a Scribd company logo
1 of 9
Session III
©Techforce Infotech Pvt Ltd 2017-18
 Express is a fast, assertive, essential and moderate web
framework of Node.js. You can assume express as a layer built
on the top of the Node.js that helps manage a server and routes.
It provides a robust set of features to develop web and mobile
applications.
 It can be used to design single-page, multi-page and hybrid web
applications.
 It allows to setup middle wares to respond to HTTP Requests.
 It defines a routing table which is used to perform different
actions based on HTTP method and URL.
 It allows to dynamically render HTML Pages based on passing
arguments to templates.
 Installing Express:- npm install -g express
Express.js
 Makes Node.js web application development fast and
easy.
 Easy to configure and customize.
 Node comes with support for low-overhead HTTP
servers.
 Creating web applications using ‘http’ is a long
process.
 Using express will give some added benefits.
 Allows you to create REST API server.
 Easy to integrate with different template engines like
Jade, Vash, EJS etc.
 Allows you to create REST API server.
Why use Express ?
 Routing based on URL paths.
 Managing sessions via cookies.
 Parsing incoming request like form data or JSON.
 Rejecting malformed requests.
Features of Express
Reques
t
Respon
se
GET
Express.js Objects
Express.js
Objects
Request Response
Routing
GET
POST
Cookies
File
Upload
 Request :- Express.js Request objects is the parameters of the call-back
function which is used in Express applications. The express.js request
object represents the HTTP request and has properties for the request
query string, parameters, body, HTTP headers, and so on.
ex:- req.accepts('html');
 Response :- The Response object (res) specifies the HTTP response
which is sent by an Express app when it gets an HTTP request.
 It sends response back to the client browser.
 It facilitates you to put new cookies value and that will write to the client
browser (under cross domain rule).
 Once you res.send() or res.redirect() or res.render(), you cannot do it again,
otherwise, there will be uncaught error.
 Ex: - res.send({ message: 'hey' });
Express.js Objects
 GET and POST Request :- GET and POST both are two common
HTTP requests used for building REST API's. GET requests are
used to send only limited amount of data because data is sent
into header while POST requests are used to send large amount
of data because data is sent in the body.
 Express.js facilitates you to handle GET and POST requests using the
instance of express.
 Cookie :- Cookies are small piece of information.
 Ex :- var express = require('express');
var parser = require(“cookie-parser”);
 File Upload :- In Express.js, file upload is slightly difficult
because of its asynchronous nature and networking approach.
 It can be done by using middleware to handle multipart/form
data. There are many middleware that can be used like multer,
connect, body-parser etc.
Express.js Objects
 Routing :- Routing is made from the word route. It is used to
determine the specific behaviour of an application. It specifies
how an application responds to a client request to a particular
route, URI or path and a specific HTTP request method (GET,
POST, etc.). It can handle different types of HTTP.
 Ex:-
Express.js Objects
app.delete('/del_student', function (req, res) {
console.log("Got a DELETE request for /del_student");
res.send('Record Deleted!');
})
Session III completed
Address: 403, Venus Benecia, Bodakdev,Ahmedabad –
380053
Reach us : reach@techforceinfotech.com
Contact no: +91 (79) 48904529

More Related Content

What's hot

Powerpoint Web Admin 2
Powerpoint Web Admin 2Powerpoint Web Admin 2
Powerpoint Web Admin 2
webhostingguy
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
Jef Claes
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
Raveendra Bhat
 

What's hot (20)

Web ,app and db server presentation
Web ,app and db server presentationWeb ,app and db server presentation
Web ,app and db server presentation
 
Webservices ingo
Webservices ingoWebservices ingo
Webservices ingo
 
Rest vs Soap
Rest vs SoapRest vs Soap
Rest vs Soap
 
Soap vs. rest - which is right web service protocol for your need?
Soap vs. rest -  which is right web service protocol for your need?Soap vs. rest -  which is right web service protocol for your need?
Soap vs. rest - which is right web service protocol for your need?
 
Soap Vs Rest
Soap Vs RestSoap Vs Rest
Soap Vs Rest
 
Restful web services ppt
Restful web services pptRestful web services ppt
Restful web services ppt
 
Powerpoint Web Admin 2
Powerpoint Web Admin 2Powerpoint Web Admin 2
Powerpoint Web Admin 2
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
 
Web server hardware and software
Web server hardware and softwareWeb server hardware and software
Web server hardware and software
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
 
Intro webapps
Intro webappsIntro webapps
Intro webapps
 
Web services soap and rest by mandakini for TechGig
Web services soap and rest by mandakini for TechGigWeb services soap and rest by mandakini for TechGig
Web services soap and rest by mandakini for TechGig
 
Architecture Best Practices
Architecture Best PracticesArchitecture Best Practices
Architecture Best Practices
 
Servlets api overview
Servlets api overviewServlets api overview
Servlets api overview
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
Backend technologies for your startup
Backend technologies for your startupBackend technologies for your startup
Backend technologies for your startup
 
Creating data centric microservices
Creating data centric microservicesCreating data centric microservices
Creating data centric microservices
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 

Similar to Node Session - 3

Xml web services
Xml web servicesXml web services
Xml web services
Raghu nath
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JS
Cosmin Mereuta
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
WalaSidhom1
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
Gaurav Bhardwaj
 

Similar to Node Session - 3 (20)

Node js crash course session 2
Node js crash course   session 2Node js crash course   session 2
Node js crash course session 2
 
ExpressJS-Introduction.pdf
ExpressJS-Introduction.pdfExpressJS-Introduction.pdf
ExpressJS-Introduction.pdf
 
ExpressJS and REST API.pptx
ExpressJS and REST API.pptxExpressJS and REST API.pptx
ExpressJS and REST API.pptx
 
Xml web services
Xml web servicesXml web services
Xml web services
 
Esc 209 paper_doin
Esc 209 paper_doinEsc 209 paper_doin
Esc 209 paper_doin
 
Mashup
MashupMashup
Mashup
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
Bt0083 server side programing
Bt0083 server side programing Bt0083 server side programing
Bt0083 server side programing
 
Study of http
Study of httpStudy of http
Study of http
 
Express node js
Express node jsExpress node js
Express node js
 
Scalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JSScalable network applications, event-driven - Node JS
Scalable network applications, event-driven - Node JS
 
gofortution
gofortutiongofortution
gofortution
 
Node.js Express Framework
Node.js Express FrameworkNode.js Express Framework
Node.js Express Framework
 
Ajax Using JSP with prototype.js
Ajax Using JSP with prototype.jsAjax Using JSP with prototype.js
Ajax Using JSP with prototype.js
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010
 
Http and REST APIs.
Http and REST APIs.Http and REST APIs.
Http and REST APIs.
 

More from Bhavin Shah (6)

Node Session - 4
Node Session - 4Node Session - 4
Node Session - 4
 
Node Session - 2
Node Session - 2Node Session - 2
Node Session - 2
 
Node Session - 1
Node Session - 1Node Session - 1
Node Session - 1
 
What is Penetration & Penetration test ?
What is Penetration & Penetration test ?What is Penetration & Penetration test ?
What is Penetration & Penetration test ?
 
Cyber security
Cyber securityCyber security
Cyber security
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Node Session - 3

  • 2.  Express is a fast, assertive, essential and moderate web framework of Node.js. You can assume express as a layer built on the top of the Node.js that helps manage a server and routes. It provides a robust set of features to develop web and mobile applications.  It can be used to design single-page, multi-page and hybrid web applications.  It allows to setup middle wares to respond to HTTP Requests.  It defines a routing table which is used to perform different actions based on HTTP method and URL.  It allows to dynamically render HTML Pages based on passing arguments to templates.  Installing Express:- npm install -g express Express.js
  • 3.  Makes Node.js web application development fast and easy.  Easy to configure and customize.  Node comes with support for low-overhead HTTP servers.  Creating web applications using ‘http’ is a long process.  Using express will give some added benefits.  Allows you to create REST API server.  Easy to integrate with different template engines like Jade, Vash, EJS etc.  Allows you to create REST API server. Why use Express ?
  • 4.  Routing based on URL paths.  Managing sessions via cookies.  Parsing incoming request like form data or JSON.  Rejecting malformed requests. Features of Express
  • 6.  Request :- Express.js Request objects is the parameters of the call-back function which is used in Express applications. The express.js request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on. ex:- req.accepts('html');  Response :- The Response object (res) specifies the HTTP response which is sent by an Express app when it gets an HTTP request.  It sends response back to the client browser.  It facilitates you to put new cookies value and that will write to the client browser (under cross domain rule).  Once you res.send() or res.redirect() or res.render(), you cannot do it again, otherwise, there will be uncaught error.  Ex: - res.send({ message: 'hey' }); Express.js Objects
  • 7.  GET and POST Request :- GET and POST both are two common HTTP requests used for building REST API's. GET requests are used to send only limited amount of data because data is sent into header while POST requests are used to send large amount of data because data is sent in the body.  Express.js facilitates you to handle GET and POST requests using the instance of express.  Cookie :- Cookies are small piece of information.  Ex :- var express = require('express'); var parser = require(“cookie-parser”);  File Upload :- In Express.js, file upload is slightly difficult because of its asynchronous nature and networking approach.  It can be done by using middleware to handle multipart/form data. There are many middleware that can be used like multer, connect, body-parser etc. Express.js Objects
  • 8.  Routing :- Routing is made from the word route. It is used to determine the specific behaviour of an application. It specifies how an application responds to a client request to a particular route, URI or path and a specific HTTP request method (GET, POST, etc.). It can handle different types of HTTP.  Ex:- Express.js Objects app.delete('/del_student', function (req, res) { console.log("Got a DELETE request for /del_student"); res.send('Record Deleted!'); })
  • 9. Session III completed Address: 403, Venus Benecia, Bodakdev,Ahmedabad – 380053 Reach us : reach@techforceinfotech.com Contact no: +91 (79) 48904529