Closed KingScooty closed 8 years ago
Hm yeah, that is for the way its designed at the moment.
In the documentation (here http://chris-l.github.io/mock-couch/#views ) I mention that the functions should be passed as functions, that is, not as strings. But this is by using mockcouch functions to add documents. If you add a design document using nano, nano will convert your function into a string before to actually sending it to mockcouch. (it make sense, there is no other way to pass a function over JSON than stringifying it)
That is, at this moment, the mockcouch is not prepared to receive design documents by any other means than using directly the mockcouch methods, ie addDoc
or addDB
.
I haven't touched the source code in a while, so I'm not sure if is possible to do it, but I'll check it out.
I've added support for this; creating a PR for ya.
I seem to be getting a 405 PUT not allowed error when trying to insert a design document;
I'm simply doing the following with nano after creating a database:
This gives the correct response when using a real couchdb database, but seems to fail when using
mock-couch
.