gstroup / apimocker

node.js module to run a simple http server for mock service responses.
MIT License
280 stars 81 forks source link

Handle multiple query parameters #82

Closed meghdeepbasu closed 6 years ago

meghdeepbasu commented 6 years ago

I have the requirement to handle multiple query parameters and send switch responses based on that. For example: my client would trigger the URL as "{host-name}/management/v1/organizations/org/oauth2/revoke?enduser=abcd&app=efgh". How should the mocker resource in api mocker should look like ? Currently, the documentation does not specify any implicit way to handle this requirement. Can you please confirm if we can handle this scenario ?

ferrerod commented 6 years ago

Using your example above and assuming {host-name} is localhost:7878 for example, your switch parameters would be 'enduser' and 'app'. So yes, apimocker supports this out of the box. See the login route example in config.json