seglo/connect-prism — pull request #12 by MilosMosovsky (2014-08-27 19:23:23+00:00)
Title: Mockable option , and OPTIONS request

Hello Sean, i found another problem while using this middleware. First is that it is "mocking" OPTIONS request, which is not good because when you are trying to PUT/POST anything , middleware is trying to mock also OPTIONS request , which makes you impossible mock PUT/POST responses because middleware is trying to allocate same json for OPTIONS and corresponding PUT/POST request because url is same , only method is changed. Maybe there should be way to add req.method to hash option so PUT method to same resource is served from another mock than POST or OPTIONS method...

Also i am inside project with approx 200+ resources and its very difficult do debug only one resource (you need to mock entire application to mock only 1 resource) i added new mode , hybrid , which is reading "mockable" option from json (default false) and when you set it to true, only these jsons are mocked. So you can easily mock only one resource. This is crucial because you can have half application programmed on backend and you want to point to real backend, and half application can be not implemented and point to to mocked jsons. This PR is only demo , if you wanna make any improvements to it , feel free to write me. Thank you .

Milos