Closed techdubb closed 9 years ago
Should be able to do app.use(cors) before adding swaggerize-express. Does this not work?
The before adding swaggerize-express
part was the bit I messed up. Working now.
Thanks for the quick reply!
No problem. Perhaps I should just embed cors support directly.
Just say no to feature creep!
:) the only reason I mention it is due to how common this need is for reading Api definitions from a swagger ui.
True. Way to make a spec that incorporates ALL the cross-cutting concerns.
I'm not sure embedding cors
directly would be needed.
Admittedly, this was a lack of experience with express middleware and the importance of .use
order.
In retrospect, using cors
prior to wsaggerize-express
makes sense, but since the "magic" of .use
is so well abstracted, the order of things isn't immediately obvious.
Is there a known way to implement CORS, especially preflight, with swaggerize-express?
Thanks!