
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
1K+ Views
The app.locals object defines the properties that are local variables inside an application. Once the value of app.locals property is set, it persists throughout the life of the application. The res.locals property is valid only for the lifetime of the request.Syntaxapp.localsExample 1Create a file "appLocals.js" and copy the following code ... Read More

Mayank Agarwal
8K+ Views
The app.listen() method binds itself with the specified host and port to bind and listen for any connections. If the port is not defined or 0, an arbitrary unused port will be assigned by the operating system that is mainly used for automated tasks like testing, etc.The app object returned ... Read More

Mayank Agarwal
700 Views
The app.engine() method is used for registering the given template engine callback as "ext". The require() method needs the engine based on the function by default.Use the following methods for engines that do not provide the extensions (or want to map different extensions) or express out of the box.app.engine('html', require('ejs').renderFile)Syntaxapp.engine(ext, ... Read More

Mayank Agarwal
561 Views
The app.enable() function sets the Boolean setting ‘name’ to ‘true’, where name defines one of the properties from the app settings table. Using the app.set('foo', true) for a Boolean property is same as calling the app.enable('foo') function.Syntaxapp.enable(name)Example 1Create a file with the name "appEnable.js" and copy the following code snippet. ... Read More

Mayank Agarwal
746 Views
The app.disable() method disables the setting name passed in the function. This method sets the setting name to False. We can perform the same function by using the app.set() method too, by passing its value as False.Syntaxapp.disable(name)Example 1Create a file with the name "appDisable.js" and copy the following code snippet. ... Read More

Mayank Agarwal
7K+ Views
The app.delete() method routes all the HTTP DELETE requests to the specified path with the specified callback functions.Syntaxapp.delete(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
3K+ Views
The app.all() method can be used for all types of routings of a HTTP request, i.e., for POST, GET, PUT, DELETE, etc., requests that are made to any specific route. It can map app types of requests with the only condition that the route should match.Syntaxapp.path(path, callback, [callback])Parameterspath − This ... Read More

Mayank Agarwal
4K+ Views
Data chunks in Node.js or any other language can be defined as a fragment of data that is sent to all the servers by the client. The servers make a stream of these chunks and form a buffer stream. This buffer stream is then converted into meaningful data.Syntaxrequest.on('eventName', [callback] )ParametersThe ... Read More

Mayank Agarwal
3K+ Views
Node.js is an event-driven JavaScript runtime platform that is built using the Chrome’s V8 JavaScript engine. Node is mainly used for building large-scale applications. In this article, we will see how to run a Java code in Node.js.StepsCheck if Node.js is already installed on your system using the following command ... Read More

Mayank Agarwal
709 Views
The main aim of a Node.js application is to work as a backend technology and serve requests and return response. But we can also pass inputs directly to a Node.js application.We can use readline-sync, a third-party module to accept user inputs in a synchronous manner.Syntaxnpm install readline-syncThis will install the ... Read More