sideshowcoder / canned

Server to respond with fake API responses, by using a directory of files for finding out what to say!
213 stars 46 forks source link

added fallback folder option for default behaviour #71

Closed erudenko closed 8 years ago

erudenko commented 9 years ago

This pull requests add following behaviour: if you provide --fallback="some/path" as param to canned it will use this path as second chance.

Why its useful: for example you are mocking API call, and have happyAllDay folder with all successful responses, but you need to implement some feature, that is not in main scenario. So you need to copy all the responses and change one you need.

Using this feature you can just create one more folder and put there only one(or some) specific file and point fallback to happyAllDay folder. So your specific folder will be provided first and everything absent there will be provided by happy all day.

sideshowcoder commented 9 years ago

That is indeed very useful, thanks for your work, I'm going to have a quick look I'm going to be out until next wednesday so sorry for not being very responsive until then. But I really like the idea and happy to get this in quickly.

sideshowcoder commented 9 years ago

Sorry to be a little pedantic about the style here but I realized it gotten a little harder to read canned over time when I came back today after not looking at the code for some time so I think improvments in this area are needed so I hope to work towards this.

sideshowcoder commented 9 years ago

How is it going, any luck making the changes so this can be merged in? I'm back and happy to help if there is need.

sideshowcoder commented 8 years ago

I think I'm going to close this for now, feel free to reopen when you get a chance!