Skip to content

Tag Archives: Express.js

The parameters of router.param() are name and a function. Where name is the actual name of parameter and function is the callback function. Basically router.param()… Read More
The req.accepts() function checks if the specified content types are acceptable on the basis of the request’s Accept HTTP header field. The method returns the… Read More
The req.range() function is basically a Range header parser where the Accept-Ranges response-header field allows the server to indicate its acceptance of range requests for… Read More
The res.app property holds a reference to the instance of the Express application that is using the middleware. Syntax: res.app Parameter: No parameters. Return Value:… Read More
The mount event is fired on a sub-app when it is mounted on a parent app and the parent app is basically passed to the… Read More
The app.locals object has properties that are local variables within the application. These variables are local to the application and are very useful. Syntax: app.locals… Read More
The app.mountpath property contains one or more path patterns on which a sub-app was mounted. Syntax: app.mountpath Parameter: No parameters. Return Value: String. Installation of… Read More
The router.METHOD() method provides the routing functionality in Express, where METHOD is one of the HTTP methods, such as GET, PUT, POST, and so on,… Read More
The req.get() function returns the specified HTTP request header field which is case-insensitive match and the Referrer and Referrer fields are interchangeable. Syntax: req.get( field… Read More
The req.is() function returns the matching content-type if the incoming request’s ‘Content-Type’ HTTP header field matches with the MIME type that has been specified by… Read More
The router.all() function is just like the router.METHOD() methods, except that it matches all HTTP methods (verbs). It is very helpful for mapping global logic… Read More
The router.route() function returns an instance of a single route that you can then use to handle HTTP verbs with optional middleware. You can also… Read More
The req.fresh property returns true if the response is still ‘fresh’ in the client’s cache else it will return false. Syntax: req.fresh Parameter: No parameter… Read More
The res.sendStatus() function is used to set the response HTTP status code to statusCode and send its string representation as the response body.Syntax:  res.sendStatus( statusCode… Read More
The req.query property is an object containing the property for each query string parameter in the route. Syntax: req.query Parameter: No parameters. Return Value: String… Read More

Start Your Coding Journey Now!