CornerCouch
CornerCouch copied to clipboard
Documentation: CORS with Iris Couch
Had some hickups to get CORS running properly on Iris Couch.
The GUI tools didn't cut it and this set of commands did the trick:
curl -X PUT http://username:[email protected]/_config/httpd/enable_cors -d '"true"'
curl -X PUT http://username:[email protected]/_config/cors/origins -d '"*"'
curl -X PUT http://username:[email protected]/_config/cors/credentials -d '"true"'
curl -X PUT http://username:[email protected]/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT http://username:[email protected]/_config/cors/headers -d '"accept, authorization, content-type, origin"'
curl -XPOST -HContent-Type:application/json https://username:[email protected]/_restart
Might be handy to add to the wiki somewhere.
yeah this should be documeted
For Windows command line users, the verbiage is a little different. Notice also the PUT command instead of POST. This differs from the PouchDB quick start guide for syncing with CouchDB (PouchDB suggests using POST).
curl -X PUT http://username:[email protected]/_config/cors/httpd/enable_cors -d "\"true\""
curl -X PUT http://username:[email protected]/_config/cors/origins -d "\"*\""
curl -X PUT http://username:[email protected]/_config/cors/credentials -d "\"true\""
curl -X PUT http://username:[email protected]/_config/cors/methods -d "\"GET, PUT, POST, HEAD, DELETE\""
curl -X PUT http://username:[email protected]/_config/cors/headers -d "\"accept, authorization, content-type, origin\""
curl -XPOST -HContent-Type:application/json http://username:[email protected]/_restart