Closed dani-fmena closed 3 years ago
The rest of the main.go file
package main import ( "github.com/kataras/iris/v12" "github.com/kataras/iris/v12/middleware/recover" "github.com/iris-contrib/swagger/v12" // swagger middleware for Iris "github.com/iris-contrib/swagger/v12/swaggerFiles" // swagger embed files "go.api.backend/api/endpoints" _ "go.api.backend/docs" ) // @title Swagger Example API // @version 1.0 // @description This is a sample server Petstore server. // @termsOfService http://swagger.io/terms/ // @contact.name API Support // @contact.url http://www.swagger.io/support // @contact.email support@swagger.io // @license.name Apache 2.0 // @license.url http://www.apache.org/licenses/LICENSE-2.0.html // @host localhost:8080 // #@BasePath /v2 func main() { app := iris.New() // Built-in app.UseRouter(recover.New()) //Recovery middleware recovers from any panics and writes a 500 if there was one. endpoints.BookRegister(app) //region ======== SWAGGER REGISTRATIONS =================================================
The sample here seems outdated. This works for me.
The rest of the main.go file