Skip to content

Commit

Permalink
Merge pull request #179 from jonasps/regex-example
Browse files Browse the repository at this point in the history
Update README.md with regex example
  • Loading branch information
ctimmerm committed Dec 25, 2018
2 parents d5ea3b6 + 850b225 commit 4e4c64b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -126,6 +126,14 @@ mock.onGet(/\/users\/\d+/).reply(function(config) {
return [200, {}];
});
```
Using variables in regex
```js
const usersUri = '/users';
const url = new RegExp(`${usersUri}/*`);

mock.onGet(url).reply(200, users);
```


Specify no path to match by verb alone

Expand Down

0 comments on commit 4e4c64b

Please sign in to comment.