Is it possible to rewrite the URL path using node.js?(I’m also using Express 3.0)
I’ve tried something like this:
req.url = 'foo';
But the url continues the same
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure, just add a middleware function to modify it. For example:
This function removes the trailing slash from all incoming request URLs. Note that in order for this to work, you will need to place it before the call to
app.use(app.router).