-
Notifications
You must be signed in to change notification settings - Fork 88
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
any way to use patterns for a path matcher? #9
Comments
Right now there's no way to do that, no. Good idea though! The former should be fairly easy, though I'd probably lean towards regexes instead. E.g. The latter is trickier, but possible too. The problem there is that for browser support you need a live connection from the mock to the browser, which it can use to run the matching code. That can come with latency too. There are similar features I'm planning anyway (mainly for dynamic responses, rather than request matching), but the former option should definitely come first. Interested in working on a PR for that? I'll get to it eventually, but if you're keen to use it I'd happily accept a PR adding it yourself. |
@cameronbraid this is now implemented on master, release coming soon. Is this what you were looking for? |
Nice - that looks great.. thanks |
Excellent. Now fixed & published as Mockttp 0.7.2, so I'm going to close this. Try it out, let me know how it goes! Thanks for the suggestion 👍 |
Hello, I was looking at allowing different RegEx patterns in the url matching. I see in the test cases you only run tests with direct regex expressions and not strings. Tried to create a regex pattern via new RegExp("some regex pattern string") but I am having match issues.
Any tips ? [Extracted as a separate issue: #96] |
I would like to be able to use path patterns like
.get("/**")
or
.get("/?**)
or most flexible :
would this be hard to add ?
The text was updated successfully, but these errors were encountered: