z0mt3c / node-restify-swagger

Swagger generation for REST-Services built with node-restify and node.js based on validation schemas of node-restify-validation.
MIT License
29 stars 16 forks source link

added headers to swagger-doc responses to work cleanly with swagger-ui. #4

Closed chimmelb closed 10 years ago

chimmelb commented 10 years ago

Default swagger-ui constantly gives "Can't access server" errors when the "Access-Control-Allow-Origin" is not set.

chimmelb commented 10 years ago

I'm not sure if this is necessarily needed, but when experimenting with this module (instead of swagger-node-restify), my swagger-ui stopped working. Modifying the code in this way allowed the swagger-ui to run without errors.

I am noticing that my responses come back empty in swagger-ui without the Access-Control-Allow-Origin header, though not with cURL, so this might just be a configuration thing.