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

Failed to load API definition. Fetch error Failed to fetch https://petstore.swagger.io/v2/swagger.json #9885

Open
zlin022 opened this issue Apr 28, 2024 · 0 comments

Comments

@zlin022
Copy link

zlin022 commented Apr 28, 2024

Dears,

I deoply the swagger-ui with docker in my local machine(CentOS 7.3) the command is like this:
docker run -d -p 9001:8080 -name swagger-ui -v /data/swagger-data/swagger/:/usr/share/nginx/html/swagger -e SWAGGER_JSON=/data/swagger-data/swagger/swagger.json swagerapi/swagger-ui
when I accsee througth the url: 192.168.13.145:9001, the page gives error like blow,

Failed to load API definition. Fetch error Failed to fetch https://petstore.swagger.io/v2/swagger.json
Fetch error
Possible cross-origin(CoRs)issue? The URl origin
does not match the page
(https://petstore.swagger.io)
(http://192.168.13.145:9001). check the server returns the correct
Access-Control-Allow-*' headers

image

so, could anyone kindly give me some help? Thanks a lot.

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