package http import "net/http" // redocHTML renders the OpenAPI spec with Redoc (loaded from a CDN), which // supports OpenAPI 3.1. const redocHTML = ` GIS API ` // openAPISpec serves the embedded OpenAPI 3.1.1 document. func (deps RouterDeps) openAPISpec(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/yaml") _, _ = w.Write(deps.OpenAPISpec) } // docsUI serves the Redoc documentation page. func docsUI(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") _, _ = w.Write([]byte(redocHTML)) }