Showing the changes to example/basic (1 of 3 files). Show all
Unified · Split
| @@ -2,8 +2,8 @@ package main · 1 unmodified line | |||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "github.com/gin-gonic/gin" | 4 | "github.com/gin-gonic/gin" |
| 5 | "github.com/swaggo/files" | ||
| 5 | "github.com/swaggo/gin-swagger" | 6 | "github.com/swaggo/gin-swagger" |
| 6 | "github.com/swaggo/gin-swagger/swaggerFiles" | ||
| 7 | 7 | ||
| 8 | _ "github.com/swaggo/gin-swagger/example/basic/docs" | 8 | _ "github.com/swaggo/gin-swagger/example/basic/docs" |
| 9 | ) | 9 | ) |
| @@ -25,7 +25,7 @@ import ( · 15 unmodified lines | |||
| 25 | func main() { | 25 | func main() { |
| 26 | r := gin.New() | 26 | r := gin.New() |
| 27 | 27 | ||
| 28 | url := ginSwagger.URL("http://localhost:8080/swagger/doc.json") //The url pointing to API definition | 28 | url := ginSwagger.URL("http://localhost:8080/swagger/doc.json") // The url pointing to API definition |
| 29 | r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url)) | 29 | r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url)) |
| 30 | 30 | ||
| 31 | r.Run() | 31 | r.Run() |