gstroup / apimocker

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

Mock url only if parameter contains variable #55

Open FabianMi opened 8 years ago

FabianMi commented 8 years ago

Hi,

I have a usecase where i want urls to be mocked only if they contain certain parameters, and else they should not deliver a mock, they should point to the real endpoint.

something like this: "var/:id": { "mockFile": "xml/queen.xml", "verbs": ["all"], "switch": "id" }

but with the combination that the default points to the real endpoint and if there is a mock file with the correct switch value than this should be delivered.

Could you please think about implementing this ? With regards, Fabian

gstroup commented 8 years ago

I can see how that would be useful. We discussed it a little before the proxy feature was added... @ztsmith was that you? What do you think?