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

any as a directory name #109

Open seafoodbuffet opened 7 years ago

seafoodbuffet commented 7 years ago

I'm trying to figure out how to use the following example from the docs:

/comment/any/votes/index.get.json

it seems to me like requests such as GET /comment/1/votes/ GET /comment/asdfasdf/votes/ or even GET /comment/2/votes

should all map to this file.

However, that doesn't appear to be the behavior I'm seeing. Instead, I get 404 errors. Is this the designed behavior or is it a bug?

sideshowcoder commented 7 years ago

Yes that should work, and if it doesn't it is indeed a bug. Thanks for reporting! If you got some time and would like to help out a testcase which reproduces is highly welcome, feel free to add it in the https://github.com/sideshowcoder/canned/blob/master/spec/canned.spec.js I feel like this should be covered by the https://github.com/sideshowcoder/canned/blob/master/spec/lookup.spec.js but I guess there is some error down the line when moving this piece of code around.