req.route Property in Express.js

Mayank Agarwal
Updated on 29-Jan-2022 08:23:35

372 Views

The req.route property contains the recently matched route in a string format.Syntaxreq.routeExample 1Create a file with the name "reqRoute.js" and copy the following code snippet. After creating the file, use the command "node reqRoute.js" to run this code as shown in the example below −// req.route Property Demo Example // Importing the express module var express = require('express'); // Initializing the express and port number var app = express(); // Initializing the router from express var router = express.Router(); var PORT = 3000; // Defining an endpoint and checking req.route app.get('/api', function (req, res) { ... Read More

Time Reversal Property of Z-Transform

Manish Kumar Saini
Updated on 29-Jan-2022 08:20:32

6K+ Views

Z-TransformThe Z-transform is a mathematical tool which is used to convert the difference equations in discrete time domain into the algebraic equations in z-domain. Mathematically, if $\mathrm{\mathit{x\left ( n \right )}}$ is a discrete time function, then its Z-transform is defined as, $$\mathrm{\mathit{Z\left [ x\left ( n \right ) \right ]\mathrm{\, =\, }X\left ( z \right )\mathrm{\, =\, }\sum_{n\mathrm{\, =\, }-\infty }^{\infty }x\left ( n \right )z^{-n}}}$$Time Reversal Property of Z-TransformStatement – The time reversal property of Z-transform states that the reversal or reflection of the sequence in time domain corresponds to the inversion in z-domain. Therefore, if$$\mathrm{\mathit{x\left ( n ... Read More

res.location() Method in Express.js

Mayank Agarwal
Updated on 29-Jan-2022 08:18:32

860 Views

The res.location() method is used for setting the response Location HTTP header to the specified path parameter. Setting the location does not end the process, one can still send some response after setting the location header.Syntaxres.location( path )Example 1Create a file with the name "resLocation.js" and copy the following code snippet. After creating the file, use the command "node resLocation.js" to run this code as shown in the example below −// res.location(path) Method Demo Example // Importing the express module var express = require('express'); // Initializing the express and port number var app = express(); // Initializing ... Read More

req.protocol Property in Express.js

Mayank Agarwal
Updated on 29-Jan-2022 08:15:20

610 Views

The req.protocol property returns the request protocol string that is either http or (for TLS requests) https. The value of X-Forwarded-Proto header field is used if present, when the passed trust proxy setting does not evaluate to False. This header values can be set either by the client or by the proxy.Syntaxreq.protocolExample 1Create a file with the name "reqProtocol.js" and copy the following code snippet. After creating the file, use the command "node reqProtocol.js" to run this code as shown in the example below −// req.protocol Property Demo Example // Importing the express module var express = require('express'); ... Read More

Time Shifting Property of Z-Transform

Manish Kumar Saini
Updated on 29-Jan-2022 08:14:46

16K+ Views

Z-TransformThe Z-transform is a mathematical tool which is used to convert the difference equations in discrete time domain into the algebraic equations in z-domain. Mathematically, if $\mathrm{\mathit{x\left ( n \right )}}$ is a discrete time function, then its Z-transform is defined as, $$\mathrm{\mathit{Z\left [ x\left ( n \right ) \right ]=X\left ( z \right )=\sum_{n=-\infty }^{\infty }x\left ( n \right )z^{-n}}}$$Time Shifting Property of Z-TransformStatement – The time shifting property of Z-transform states that if the sequence $\mathrm{\mathit{x\left ( n \right )}}$ is shifted by n0 in time domain, then it results in the multiplication by $\mathrm{\mathit{z^{-n_{\mathrm{0}}}}}$ in the z-domain. ... Read More

Time Convolution and Frequency Convolution Properties of Discrete Time Fourier Transform

Manish Kumar Saini
Updated on 29-Jan-2022 08:07:49

6K+ Views

Discrete-Time Fourier TransformThe Fourier transform of a discrete-time sequence is known as the discrete-time Fourier transform (DTFT). Mathematically, the discrete-time Fourier transform of a discrete-time sequence $\mathrm{\mathit{x\left ( n \right )}}$ is defined as −$$\mathrm{\mathit{F\left [ x\left ( n \right ) \right ]=X\left ( \omega \right )=\sum_{n=-\infty }^{\infty }x\left ( n \right )e^{-j\, \omega n}}}$$Time Convolution Property of DTFTStatement – The time convolution property of DTFT states that the discretetime Fourier transform of convolution of two sequences in time domain is equivalent to multiplication of their discrete-time Fourier transforms. Therefore, if$$\mathrm{\mathit{x_{\mathrm{1}}\left ( n \right )\overset{FT}{\leftrightarrow}X_{\mathrm{1}}\left ( \omega \right )\: \: ... Read More

Res Links Method in Express.js

Mayank Agarwal
Updated on 29-Jan-2022 08:07:18

542 Views

The res.links() method is used for joining two links that are provided as properties of the parameter to populate the response’s Link HTTP header value.Syntaxres.links( links )Example 1Create a file with the name "resLinks.js" and copy the following code snippet. After creating the file, use the command "node resLinks.js" to run this code as shown in the example below −// res.links(links) Method Demo Example // Importing the express module var express = require('express'); // Initializing the express and port number var app = express(); // Initializing the router from express var router = express.Router(); var PORT = ... Read More

res.locals Property in Express.js

Mayank Agarwal
Updated on 29-Jan-2022 08:06:13

8K+ Views

The res.locals is an object that contains the local variables for the response which are scoped to the request only and therefore just available for the views rendered during that request or response cycle.This property is useful while exposing the request-level information such as the request path name, user settings, authenticated user, etc.Syntaxres.localsExample 1Create a file with the name "resLocals.js" and copy the following code snippet. After creating the file, use the command "node resLocals.js" to run this code as shown in the example below −// res.locals Property Demo Example // Importing the express module var express = require('express'); ... Read More

Linearity, Periodicity and Symmetry Properties of Discrete Time Fourier Transform

Manish Kumar Saini
Updated on 29-Jan-2022 08:01:09

7K+ Views

Discrete-Time Fourier TransformThe Fourier transform of a discrete-time sequence is known as the discrete-time Fourier transform (DTFT). Mathematically, the discrete-time Fourier transform of a discrete-time sequence $\mathrm{\mathit{x\left ( n \right )}}$ is defined as −$$\mathrm{\mathit{F\left [ x\left ( n \right ) \right ]\mathrm{\, =\, }X\left ( \omega \right )\mathrm{\, =\, }\sum_{n\mathrm{\, =\, }-\infty }^{\infty }x\left ( n \right )e^{-j\, \omega n}}}$$Linearity Property of Discrete-Time Fourier TransformStatement – The linearity property of discrete-time Fourier transform states that, the DTFT of a weighted sum of two discrete-time sequences is equal to the weighted sum of individual discrete-time Fourier transforms. Therefore, if$$\mathrm{\mathit{F\left [ ... Read More

Router Use Method in Express.js

Mayank Agarwal
Updated on 29-Jan-2022 07:45:17

2K+ Views

The router.use() method has an optional mount path which is set to "/" by default. This method uses the specified middleware functions for this optional mountpath. The method is similar to app.use().Syntaxrouter.use( [path], [function, ...] callback )Example 1Create a file with the name "routerUse.js" and copy the following code snippet. After creating the file, use the command "node routerUse.js" to run this code as shown in the example below:// router.use() Method Demo Example // Importing the express module const express = require('express'); // Initializing the express and port number var app = express(); // Initializing the router ... Read More

Advertisements