Configure Swagger UI through docker?
The curl Swagger is doing is:
Which is giving the fail:
Failed to fetch.
Possible Reasons:
CORS
Network Failure
URL scheme must be "http" or "https" for CORS request.
I'm using the default template + swaggerUI.
I tried ScalarUI with the same results
11 Replies
ipv6 localhost would be [::1]
I don't get it. Could you elaborate?
you said [::] above
I did, that's what I get as base url
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://[::]:8080
0.0.0.0.0.0
I don't even know how to change it. I don't know why when I execute the queries they are failing.
If I do them in postman with localhost:8080 they work.
:: here just means unspecified address
Ou, how should I define it?
it's listening on all, but to connect you need to specify one, so you can use ::1
like 127.0.0.1 or localhost
still, only working from postman, not Swagger
(I'm running it from docker)
are you running the server outside docker, and curl inside docker?
No, server inside docker, and the curl outside (like postman is doing I guess)
you can try starting the container with port mapping
-p 8080:8080
then outside localhost:8080 would be forwarded to 8080 inside the container
or might be able to do docker inspect and find the container's ip address and connect directly