Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to fetch at 'http://localhost:8000/api/v1' from origin 'http://0.0.0.0:8000' has been blocked by CORS policy #194

Closed
will-wright-eng opened this issue Jan 30, 2023 · 1 comment

Comments

@will-wright-eng
Copy link

This issue is well documented but my attempts have been unsuccessful... any suggestions are welcome!

Recreating Error

cookiecutter gh:Buuntu/fastapi-react --no-input
cd fastapi-react-project

modified files before running build script (in order to address prior errors):

frontend/Dockerfile
line 7

RUN npm install --legacy-peer-deps

docker-compose.yml
line 37

  # flower:
  #   image: mher/flower
  #   command: celery flower --broker=redis://redis:6379/0 --port=5555
  #   ports:
  #       - 5555:5555
  #   depends_on:
  #     - "redis"
cd fastapi-react-project
chmod +x scripts/build.sh
./scripts/build.sh

Access to fetch at 'http://localhost:8000/api/v1' from origin 'http://0.0.0.0:8000' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space local.

GET http://localhost:8000/api/v1 net::ERR_FAILED api.ts:4 <-- fetch()

Attempts

System

➜ uname -v
# Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64
➜ docker-compose version
# Docker Compose version v2.13.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant