Files
ai_site/platform/internal/handler/openapi_serve.go
2026-07-31 10:31:17 +08:00

19 lines
386 B
Go

package handler
import (
_ "embed"
"net/http"
)
//go:embed openapi.yaml
var openapiYAML []byte
func openapiHandler() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/yaml; charset=utf-8")
w.Header().Set("Cache-Control", "public, max-age=60")
w.WriteHeader(http.StatusOK)
_, _ = w.Write(openapiYAML)
}
}