app.path()
Returns the canonical path of the app, a string.
1 2 3 4 5 6 7 8 9 10 | var app = express() , blog = express() , blogAdmin = express(); app.use( '/blog' , blog); blog.use( '/admin' , blogAdmin); console.log(app.path()); // '' console.log(blog.path()); // '/blog' console.log(blogAdmin.path()); // '/blog/admin' |
The behavior of this method can become very complicated in complex cases of mounted apps: it is usually better to use req.baseUrl to get the canonical path of the app.
Please login to continue.