Closed rast1025 closed 2 years ago
I want to be able to access my swagger file by url /swagger.json instead of /doc.json. Found this code, any idea how can I do it not changing code?
switch path { case "index.html": _ = index.Execute(c.Writer, config) case "doc.json": doc, err := swag.ReadDoc() if err != nil { c.AbortWithStatus(http.StatusInternalServerError) return } _, _ = c.Writer.Write([]byte(doc)) default: handler.ServeHTTP(c.Writer, c.Request) }
I want to be able to access my swagger file by url /swagger.json instead of /doc.json. Found this code, any idea how can I do it not changing code?