Serve serves the documentation.
(ctx *gin.Context)
| 13 | |
| 14 | // Serve serves the documentation. |
| 15 | func 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 | |
| 23 | func getSwaggerJSON(base string) string { |
| 24 | return strings.Replace(spec, "localhost", base, 1) |
searching dependent graphs…