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
Currently, access these urls are difference:
/posts /posts/
How to make these urls the same?
Currently, I have to define two paths for the same view:
const routes = [ { path: "/posts", view: Posts }, { path: "/posts/", view: Posts }, ];
The text was updated successfully, but these errors were encountered:
try changing this: const pathToRegex = path => new RegExp("^" + path.replace(/\//g, "\\/").replace(/:\w+/g, "(.+)") + "$"); to this:`const pathToRegex = path => new RegExp("^" + path.replace(///g, "\/").replace(/:\w+/?/g, "(.+)") + "$");
const pathToRegex = path => new RegExp("^" + path.replace(/\//g, "\\/").replace(/:\w+/g, "(.+)") + "$");
result: location.pathname.match(pathToRegex(route.path))
to this:
result: location.pathname.replace(/\/$/g, "").match(pathToRegex(route.path))
Note: Tested and works for me
Sorry, something went wrong.
RegEx updated
f94e494
Following @Pant 's suggestion in dcode-youtube#7 (comment), I have made this change. I have now tried it for a few days, and it seems to work well.
No branches or pull requests
Currently, access these urls are difference:
How to make these urls the same?
Currently, I have to define two paths for the same view:
The text was updated successfully, but these errors were encountered: