![]() |
VOOZH | about |
The app.path() function returns the canonical path of the app as a string. When mounting advanced apps, the behavior of this approach can become extremely complicated. In most cases, it is better to use req.baseUrl to obtain the app's canonical path.
Installation of the express module:
npm install express
npm version express
node index.js
Filename: index.js
Steps to run the program:
npm install express
node index.js
Output:
'' '/user' '/user/admin'
So this is how you can use the express app.path() function that returns the canonical path of the app as a string.