Using wildcards in URL #29
-
Can we replace portions of URL with a wildcard, asterisk or something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, you are right on time, just released version v1.1.0 which supports this. URL such as
These are basically same for now as you cannot use the param and response are static. In future, you can also add a response handler, there these params will be useful. |
Beta Was this translation helpful? Give feedback.
Yes, you are right on time, just released version v1.1.0 which supports this.
URL such as
{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.{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…