From d6480525db461814cef71ddafadb03176b178763 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Tue, 23 Feb 2021 14:18:07 +0530 Subject: [PATCH] added swagger --- main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main.go b/main.go index 8caf3b3..0d9d59b 100644 --- a/main.go +++ b/main.go @@ -14,8 +14,19 @@ import ( "github.com/gin-gonic/gin" "github.com/jasonlvhit/gocron" _ "github.com/joho/godotenv/autoload" + swaggerFiles "github.com/swaggo/files" + ginSwagger "github.com/swaggo/gin-swagger" + + _ "github.com/akhilrex/podgrab/docs" ) +// @title Podgrab API +// @version 1.0 +// @description This is the api documentation for Podgrab. +// @contact.name Podgrab Github +// @contact.url https://www.github.com/akhilrex/podgrab +// @securityDefinitions.basic BasicAuth + func main() { var err error db.DB, err = db.Init() @@ -144,6 +155,7 @@ func main() { router.POST("/opml", controllers.UploadOpml) router.GET("/opml", controllers.GetOmpl) router.GET("/player", controllers.PlayerPage) + router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) r.GET("/ws", func(c *gin.Context) { controllers.Wshandler(c.Writer, c.Request)