CornerCouch icon indicating copy to clipboard operation
CornerCouch copied to clipboard

Documentation: CORS with Iris Couch

Open khawkins98 opened this issue 11 years ago • 2 comments

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.

khawkins98 avatar Dec 12 '13 15:12 khawkins98

yeah this should be documeted

fgrs avatar Sep 26 '14 22:09 fgrs

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

gitsnabby avatar Oct 18 '14 03:10 gitsnabby