Skip to content

Instantly share code, notes, and snippets.

@ryaninvents
Last active August 29, 2015 14:17
Show Gist options
  • Save ryaninvents/009739d12186945a23c2 to your computer and use it in GitHub Desktop.
Save ryaninvents/009739d12186945a23c2 to your computer and use it in GitHub Desktop.
PouchDB CORS setup
if [ -z "$COUCH_HOST" ]; then
echo "Need to set COUCH_HOST"
exit 1
fi
curl -X PUT $COUCH_HOST/_config/httpd/enable_cors -d '"true"'
curl -X PUT $COUCH_HOST/_config/cors/origins -d '"*"'
curl -X PUT $COUCH_HOST/_config/cors/credentials -d '"true"'
curl -X PUT $COUCH_HOST/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT $COUCH_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