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
- put request described in https://docs.cloudant.com/cors.html#setting-the-cors-configuration
- checked dashboard local instance not have "account" tab available.
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 offalse
in
[cors]
section, add lineorigins = 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
Post a Comment