-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
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
Allow using route params #205
base: master
Are you sure you want to change the base?
Conversation
great solution, what happened? |
This is great feature, what happened which this pull request? Thanks you so much 😄 |
Has this PR been rejected silently? |
Any news? |
Can this please be merged? |
I was looking for something exactly like this. There don't appear to be any showstoppers here from merging this, right? |
This should be merged. Keeping a PR open for this long is never a good Idea. Reject or (resolve conflicts and) merge, but please don't ignore, dear Axios authors. |
Such a needed and requested feature 😞 |
Still not merged after 2 years? |
https://github.com/pillarjs/path-to-regexp could be embed, it's used in express and react-router |
I used a different approach which doesn't require a 3rd argument in https://github.com/ctimmerm/axios-mock-adapter/pull/316/files. |
Working with route params is more convenient than defining the regex in the matcher itself (avoids duplication of regexes for similar routes, allows using the same routes you have on the backend or in the API spec etc.)
This implementation:
config.routeParams
:userId
) and curly braces ({userId}
) for route paramsExample using the colon notation:
Example using the curly braces notation:
This addresses requests from #199 and #82