Skip to content

Using wildcards in URL #29

Answered by mukuljainx
Angelina1984 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you are right on time, just released version v1.1.0 which supports this.

URL such as

  1. {base}/service/chat/user/:userId/messages can be added. All the URL such as {base}/service/chat/user/u1/messages or {base}/service/chat/user/u2/messages will be matched though response will remain the same. In future userId, will available as param just like express and you can provide a handler function where mock can be generated based on query params and params.

  2. {base}/service/some/thing/(.*) can also be added, (.*) will match anything just like the above but will not available as params for obvious reasons.

These are basically same for now as you cannot use the param and response are static…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mukuljainx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants