joffrey-bion / livedoc

A not-so-annotation-based documentation generator for REST and websocket services
MIT License
4 stars 2 forks source link

Support cross-origin requests on the jsondoc endpoint #35

Closed joffrey-bion closed 7 years ago

joffrey-bion commented 7 years ago

Currently, the server providing the JSON documentation and the UI need to be on the same host, because cross-origin requests are forbidden.

This is a pity because we need to allow external domains to fetch and display the doc their own way, if someone wants to write his own UI hosted somewhere else and access the JSON documentation endpoint.

This can be done by enabling CORS support on the generated controller (in the Spring flavor of Livedoc).