Can't read from server. It may not have the appropriate access-control-origin settings - heeelp!

1,196 views
Skip to first unread message

Vanessa Nunez

unread,
May 30, 2016, 3:02:39 PM5/30/16
to Swagger
Hello,

I need help, rs.

he server returns the following message:
"Can't read from server. It may not have the appropriate access-control-origin settings."

My URL API: http://localhost:8081/v2/api-docs.json
My URL Swagger UI: http://localhost:8080/

I'm using Spring Framework.

When I try curl by terminal, the response is:

curl -I "http://127.0.0.1:8080/v2/api-docs"
HTTP/1.1 404 Not Found
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8
Content-Length: 25
Date: Mon, 30 May 2016 18:59:34 GMT
Connection: keep-alive

Someone can help me?

(Sorry about the english)

Ron Ratovsky

unread,
May 31, 2016, 2:45:47 AM5/31/16
to swagger-sw...@googlegroups.com

Hi Vanessa,

 

It looks like you need to enable cors in your application (https://github.com/swagger-api/swagger-ui#cors-support).

Assuming you use Springfox – you should look at their documentation for further assistance (though you can use a generic filter to do that).

If you’re using swagger-core, let me know and I’ll guide you to the solution.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages