Skip to content
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

Catch all nested paths #26

Open
muratcorlu opened this issue Sep 27, 2018 · 1 comment
Open

Catch all nested paths #26

muratcorlu opened this issue Sep 27, 2018 · 1 comment

Comments

@muratcorlu
Copy link
Owner

To have a chance to define a mock that will catch all requests that starts with a path could be great.

For example, lets say we have 2 endpoints like below:

/api/users/3123123/messages/321
/api/users/4343/messages
/api/users/213

For now there is no chance to catch all these 3 endpoints with a single custom middleware. Maybe to have a mock definition in a path like below could be useful:

mocks/api/users/__user_id*__/ANY.js

Notice the star char in the wildcard name. That could mean, that wildcard will match all of this paths and nested paths.

Let's think about this...

@BennyAlex
Copy link

the correct path would be mocks/api/users/__user_id__/*/ANY.js so the * indicated to use all nested paths, but a user id is still required.
mocks/api/users/*/ANY.js would match all even without user id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants