Added ignoreTrailingSlash router option #1632
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pre-Submission Checklist
make prepush
Issues
Closes:
This is my first pr in this project and I didn't know the rule "Opened an issue discussing these changes before opening the PR". Since I've already did all the work I hope it is ok if I open it anyway. Sorry for the inconvenience.
Changes
Added ignoreTrailingSlash router option.
find-my-way
does not support by default trailing slash in routes, so/path
and/path/
are not the same thing (and the one with the trailing slash will be a 404).If a user needs this specific behaviour it can pass
{ ignoreTrailingSlash: true }
tofind-my-way
. The result will be that internallyfind-my-way
will register two routes/path
and/path/
, this will be seen in the debug log.This pr add the possibility to pass this option (and possibly more) to
find-my-way
.@hekike can you review? Thanks.