Open szimek opened 7 years ago
No, this doesn't exist, but should be easy to add. Feel free to open a PR and I'll check it out.
Is this not already accessible in with req.originalUrl
?(http://expressjs.com/en/api.html#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).
I got the following code:
Is there any way to get the original path (before rewrite) inside the handler for
/index.html
path?