package spec import ( _ "embed" "net/http" "github.com/uptrace/bunrouter" ) //go:embed openapi.yaml var openapiYAML []byte // SpecHandler serves the raw OpenAPI YAML spec. func SpecHandler() bunrouter.HandlerFunc { return func(w http.ResponseWriter, req bunrouter.Request) error { w.Header().Set("Content-Type", "application/yaml") _, err := w.Write(openapiYAML) return err } } // DocsHandler serves the Scalar API reference UI. func DocsHandler() bunrouter.HandlerFunc { return func(w http.ResponseWriter, req bunrouter.Request) error { w.Header().Set("Content-Type", "text/html; charset=utf-8") _, err := w.Write([]byte(` vecna API `)) return err } }