MCPcopy Index your code
hub / github.com/gotify/server / Serve

Function Serve

docs/swagger.go:15–21  ·  view source on GitHub ↗

Serve serves the documentation.

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

13
14// Serve serves the documentation.
15func Serve(ctx *gin.Context) {
16 base := location.Get(ctx).Host
17 if basePathFromQuery := ctx.Query("base"); basePathFromQuery != "" {
18 base = basePathFromQuery
19 }
20 ctx.Writer.WriteString(getSwaggerJSON(base))
21}
22
23func getSwaggerJSON(base string) string {
24 return strings.Replace(spec, "localhost", base, 1)

Callers 1

TestServeFunction · 0.85

Calls 1

getSwaggerJSONFunction · 0.85

Tested by 1

TestServeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…