javascript - Enable CORS on Cloudant local -


i have setup cloudant local database using docker image.

when try send in cloudant query using javascript application hosted on localhost:8000 gives me cors error.

how enable cors on cloudant local? have tried following

  1. put request described in https://docs.cloudant.com/cors.html#setting-the-cors-configuration
  2. checked dashboard local instance not have "account" tab available. cloudant local dashboard

same answer @anirus, there's very kludgy way around it. if have named container cloudant-developer in current instructions @ https://hub.docker.com/r/ibmcom/cloudant-developer/:

  • save stock default.ini file locally:

    docker exec cloudant-developer cat /opt/cloudant/etc/default.ini > default.ini

  • modify enable_cors = true instead of false

  • in [cors] section, add line origins = http://localhost:3000. should take comma delimited list, you're working on 1 app @ time.

  • volume mount modified default.ini on original whenever run container adding -v `pwd`/default.ini:/opt/cloudant/etc/default.ini docker's list of command line arguments:

    docker run --privileged --detach --volume cloudant:/srv -v `pwd`/default.ini:/opt/cloudant/etc/default.ini --name cloudant-developer --publish 8080:80 --hostname cloudant.dev ibmcom/cloudant-developer


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -