
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Mayank Agarwal has Published 373 Articles

Mayank Agarwal
2K+ Views
express.raw() is a built-in middleware function in Express. It parses the incoming requests into a buffer and it is based upon the body-parser. This method returns the middleware that parses all JSON bodies as buffer and only looks at the requests where the content-type header matches the type option.Syntaxexpress.raw([options])ParametersFollowing are the ... Read More

Mayank Agarwal
15K+ Views
express.json() is a built-in middleware function in Express. This method is used to parse the incoming requests with JSON payloads and is based upon the bodyparser.This method returns the middleware that only parses JSON and only looks at the requests where the content-type header matches the type option.Syntaxexpress.json([options])ParametersFollowing are the ... Read More

Mayank Agarwal
12K+ Views
The app.use() method mounts or puts the specified middleware functions at the specified path. This middleware function will be executed only when the base of the requested path matches the defined path.Syntaxapp.use([path], callback, [callback])Parameterspath − This is the path for which the middleware function is invoked. A path can be ... Read More

Mayank Agarwal
3K+ Views
The app.set() function assigns or sets a setting name to value. This can store any type of value as the user wants, but there are some certain names that can be used to configure the behaviour of the serverSome of the properties that can be configured with the set functionality ... Read More

Mayank Agarwal
1K+ Views
The app.route() method returns the instance of a single route. This single route can be used to handle the HTTP verbs with the optional middleware. This method is mainly used to avoid duplicate names.Syntaxapp.route( )Example 1Create a file with the name "appRoute.js" and copy the following code snippet. After creating ... Read More

Mayank Agarwal
2K+ Views
The app.render() method is used for returning the rendered HTML of a view using the callback function. This method accepts an optional parameter that is an object which contains the local variables for the view.This method is similar to the res.render() function with the difference that it cannot send the ... Read More

Mayank Agarwal
8K+ Views
The app.post() method routes all the HTTP POST requests to the specified path with the specified callback functions.Syntaxapp.path(path, callback, [callback])Parameterspath − This is the path for which the middleware function is invoked. A path can be a string, path pattern, a regular expression or an array of all these.callback − ... Read More

Mayank Agarwal
669 Views
The app.path() method returns the canonical path. The path is returned as a string. It is better to use the req.baseUrl method since the app.path() method can be very complicated in complex cases of mounted apps.Syntaxapp.path( )Example 1Create a file with the name "appPath.js" and copy the following code snippet. ... Read More

Mayank Agarwal
1K+ Views
The app.param() method is basically used for adding the callback triggers to the route parameters, where name represents the name of the parameter or an array of them and callback represents the callback function.Syntaxapp.param([name], callback)Parametersname − Represents the name of the parameter or array of parameters as required.callback − Represents ... Read More

Mayank Agarwal
503 Views
The app.mountpath property contains those path patterns on which a sub-app was mounted. A sub-app can be defined as an instance of Express that may be used for handling the request to a route.This property is similar to the baseUrl property of the req object; the only difference is that ... Read More