-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
36 lines (27 loc) · 904 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"github.com/gofiber/fiber/v2"
_ "github.com/pcminh0505/gofiber-casbin/api/models" // swagger handler
"github.com/pcminh0505/gofiber-casbin/api/routes"
_ "github.com/pcminh0505/gofiber-casbin/docs" // docs is generated by Swag CLI
"github.com/pcminh0505/gofiber-casbin/infras/database"
"github.com/pcminh0505/gofiber-casbin/middleware"
)
// @termsOfService http://swagger.io/terms/
// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email [email protected]
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
func main() {
app := fiber.New(fiber.Config{
BodyLimit: 1024 * 1024 * 2014, // 1 GB
})
middleware.FiberMiddleware(app)
middleware.SwaggerMiddleware(app)
database.Connect()
routes.Setup(app)
routes.Swagger(app)
routes.NotFoundRoute(app)
app.Listen("localhost:8000")
}