krakenjs / swaggerize-express

Design-driven apis with swagger 2.0 and express.
Other
354 stars 81 forks source link

api.host is changing it's content based on express hostname #103

Open amunhoz opened 8 years ago

amunhoz commented 8 years ago

Hi there, First, thanks for this code... that's awesome.

Second, when i access the api-docs url, it is changing the host property of the api configuration by it's own. The problem is, if i don't put any hostname in express, the host generated is like ":::8000", and that is creating some problems with the swagger-UI.

I really could not find where it is changing that... had to make a modification in "expressroutes.js " to make it work.

router.get(mountpath + options.docspath, function (req, res) { options.api.host = req.headers.host; res.json(options.api); });

Thanks