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

Wildcard not detected when in the middle of the path #66

Closed omerts closed 8 years ago

omerts commented 9 years ago

Hello,

I am trying to use the "any" wildcard, but in the middle of the path, for example:

http://127.0.0.1:3000/213/pic

My folder hierarchy is: /any/pic/index.get.json

Thanks, Omer

sideshowcoder commented 9 years ago

@msurdi might know more I just looked into it and I seem to have the same problem and realized this is actually not covered by the tests as the feature was just added in #64. I added some tests in #67 to cover and investigate this.

msurdi commented 9 years ago

@sideshowcoder I've just submitted a PR which should make all tests pass again. That was definitely a bug.

Having said that, I still don't understand the relation of that issue with the problem reported here by @omerts . I've tried it before fixing the bug and it worked fine for me. @omerts , Did you install from npm repository? or were you trying the master branch from github?

omerts commented 9 years ago

@msurdi I installed from the npm repository

msurdi commented 9 years ago

That would explain it then, I think this feature isn't present in any release yet. If you want to try it out, reinstall it with: npm install -g sideshowcoder/canned

sideshowcoder commented 9 years ago

Yeah this is scheduled for the next release, most likely later this week. thanks @msurdi I didn't even think about that.

omerts commented 9 years ago

@msurdi using npm install -g sideshowcoder/canned, makes it work perfectly. Thank you. Just as a side note (if it is on purpose), maybe add to the docs that the :id part has to be numeric. I don't mind adding it myself, but I want to make sure it is on purpose.

git-jiby-me commented 8 years ago

@sideshowcoder I think this is already fixed, close it ?

sideshowcoder commented 8 years ago

Yes indeed :) close it!