Skip to content

Instantly share code, notes, and snippets.

@Juszczak
Created July 6, 2015 20:23
Show Gist options
  • Save Juszczak/0239f53bfdd9a0418d37 to your computer and use it in GitHub Desktop.
Save Juszczak/0239f53bfdd9a0418d37 to your computer and use it in GitHub Desktop.
Add some generic CORS configuration to your CouchDB using curl. You can always change the configuration by simply going to http://127.0.0.1:5984/_utils/config.html and updating the values. However, these default options are good for getting up and running.
HOST=http://name:password@127.0.0.1:5984 # or whatever you got
curl -X PUT $HOST/_config/httpd/enable_cors -d '"true"'
curl -X PUT $HOST/_config/cors/origins -d '"*"'
curl -X PUT $HOST/_config/cors/credentials -d '"true"'
curl -X PUT $HOST/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT $HOST/_config/cors/headers -d '"accept, authorization, content-type, origin, referer, x-csrf-token"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment