richhollis / swagger-docs

Generates swagger-ui json files for Rails APIs with a simple DSL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

My basepath keeps reverting to localhost:3000 no matter what

kristophM opened this issue · comments

After I run rake swagger:docs on staging/production, the api-docs.json file shows that basePath: http://.....com. However, when I go inspect the file after exiting the console, it shows basePath: localhost:3000.

Similarly, I get these errors in the browser console: https://www.dropbox.com/s/gx0myq6res1172c/Screenshot%202015-12-21%2018.36.16.png?dl=0

And this error at the top of the browser from the Swagger javascript:
Unable to read api 'state_taxes' from path http://localhost:3000/api/v1/state_taxes.json (server returned undefined)

Any idea what might be causing this? When I run it in development (because it's actually on localhost:3000), it works fine.

Thank you!

I'm guessing there is something in your production environment that is preventing it from working. Can the browser actually load the json files correctly. Do you have CORS in place etc?