Skip to content

Optional regex URI matching

Compare
Choose a tag to compare
@quii quii released this 21 Jan 13:53
· 332 commits to master since this release

This release introduces an optional field to the configuration, regexuri

---
 - name: Regex example
   request:
     uri: /hello/chris
     regexuri: \/hello\/[a-z]+
     method: GET
   response:
     code: 200
     body: '{"message": "hello, there"}'
     headers:
       content-type: text/json

When running in server mode, if you define a regex URI then the server will match on this if the incoming URL doesn't match any "concrete" uri.

This allows the fake server to be a bit more flexible.

Please note that the uri field is still required. The reason for this is that it is needed for the consumer driven contract functionality (how would it know what URL to hit if all it has is a regex).

The uri you define must match against the regexuri if supplied