wkennedy / swagger4spring-web

Swagger support for Spring MVC
89 stars 46 forks source link

how can I set the action url of the send button in swaggaer4spring-web? #93

Open verystrongjoe opened 9 years ago

verystrongjoe commented 9 years ago

I am using swagger4spring-web. I applied my application well. It worked well. But If I load this web application to other server, it occurs the CORS problem.

Loading the apis from my application, it works well. If I push the test button, "try it out", it failed because,It set "localhost" by default.

I want to set the action url of the button "try it out".

How can I fix it? I want to change this url to the real ip address.

swagger swagger-ui

verystrongjoe commented 9 years ago

url = this.options.url; if (url.indexOf("http") !== 0) { url = this.buildUrl(window.location.href.toString(), url); }

Finally, I found this. It brings the url of address url of browser. I close this by myself.

verystrongjoe commented 9 years ago

Even if I put my ip address bar, CORS error still occurs.

GET http://70.50.223.168:8090/documentation/images/throbber.gif 404 (Not Found)
(index):1 XMLHttpRequest cannot load http://localhost:8090/api/v1/odlis. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://70.50.223.168:8090' is therefore not allowed access.