Closed misantronic closed 8 years ago
Thanks for the report, this seems like a bug which I though would have been covered by the tests but I guessed worngly. If you like to help out identifying the problem it would be great if you could add a test to the /spec/
directory. I will try to figure out what is going on as soon as possible.
@misantronic how are you attempting to view localhost:5000/customer
?
I had an issue where I was seeing a 404 error when trying to access a .json
file by opening in the browser, but that doesn't work. After debugging, I realised that accessing the URL via the browser sets the Content-Type
as html
, therefore canned is trying to retrieve a HTML file.
Is that the case for you?
Thank you for your replies. I actually just tested canned in the browser. I will try it tomorrow via ajax!
/EDIT: Works fine, thanks a lot!
Awesome, glad to hear! The same thing caught me out last week.
@CheungJ @misantronic anybody mind taking a look if this makes sense to you? https://github.com/sideshowcoder/canned/pull/101
I have the following file-structure:
I start canned via
$ canned -p 5000 ./api
localhost:5000/ works. localhost:5000/customer is not working ->
request: get /customer/ not found
When I replace
/api/customer/index.get.json
with/api/customer/index.get.html
it works as HTML-file. I also tested all other possibilities from the docs, but I cannot get json-files to work :/canned: 0.3.8 node: 5.11.0