We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I got the following code:
app.use(history()); app.get('/index.html', (req, res) => { ... }
Is there any way to get the original path (before rewrite) inside the handler for /index.html path?
/index.html
The text was updated successfully, but these errors were encountered:
No, this doesn't exist, but should be easy to add. Feel free to open a PR and I'll check it out.
Sorry, something went wrong.
Is this not already accessible in with req.originalUrl ?(http://expressjs.com/en/api.html#req.originalUrl)
req.originalUrl
This example seems to work for me
const express = require("express"); var history = require("connect-history-api-fallback"); const app = express() app.use(history({ verbose: true, index: '/' })); app.get("/", function(req, res) { console.log("Responding from", req.originalUrl); res.send("Hello World"); }); app.listen(3000);
This works with express, yes, but please note the different values compared to req.url (see the docs).
req.url
No branches or pull requests
I got the following code:
Is there any way to get the original path (before rewrite) inside the handler for
/index.html
path?The text was updated successfully, but these errors were encountered: