Express Parameters
Express Parameters
Express js is a Node.js framwork for building APIs, web application and cross-
platform mobile apps.
EXpress is a high performance, fast, unopinionatedm and lightweight.
It is used as a server side scripting lanhuage.
It is used to build a single page, multipage, and hybrid web application.
It's a layer built on the top of the Node js that helps manage servers and routes.
Time-efficient
Fast
Economical
Easy to learn
Asynchronous
Express commands
You can install it using this command:
npm install express-session
first create a new Node.js project with this command: npm init -y
then run:
npm install express
Save this to an index.js file in your project root folder, and start the server
using this command:
node index.js
Request Parameters
I mentioned how the Request object holds all the HTTP request information.
Property Description
.app holds a reference to the Express app object
.baseUrl the base path on which the app responds
.body contains the data submitted in the request body (must be parsed and populated
manually before you can access it)
.cookies contains the cookies sent by the request (needs the cookie-parser
middleware)
.hostname the hostname as defined in the Host HTTP header value
.ip the client IP
.method the HTTP method used
.params the route named parameters
.path the URL path
.protocol the request protocol
.query an object containing all the query strings used in the request
.secure true if the request is secure (uses HTTPS)
.signedCookies contains the signed cookies sent by the request (needs the
cookie-parser middleware)
.xhr true if the request is an XMLHttpRequest