Skip to content
Discussion options

You must be logged in to vote

Hi @akhayyat. The simplest way to do this would be to disable the built-in docs renderers and set your own route, e.g.:

config := huma.DefaultConfig("Your App", version)
config.DocsPath = ""

router = humachi.New(mux, config)
router.Adapter().Handle(&huma.Operation{
  Method: http.MethodGet,
  Path:   server.apiPath + "/docs",
  }, func(ctx huma.Context) {
  ctx.SetHeader("Content-Type", "text/html")
  if _, err := ctx.BodyWriter().Write([]byte(`<!doctype html><html lang="en"><head><title>Your App - API Reference</title><meta charset="utf-8"><meta content="width=device-width,initial-scale=1" name="viewport"></head><body><script data-url="` + server.apiPath + `/docs.json" id="api-reference…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@akhayyat
Comment options

Answer selected by wolveix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants