Add recover middleware

This commit is contained in:
video-prize-ranch
2022-04-22 11:38:09 -04:00
parent 6c49dee732
commit 4a41e59d34

View File

@@ -9,6 +9,7 @@ import (
"codeberg.org/video-prize-ranch/rimgo/views" "codeberg.org/video-prize-ranch/rimgo/views"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem" "github.com/gofiber/fiber/v2/middleware/filesystem"
"github.com/gofiber/fiber/v2/middleware/recover"
"github.com/gofiber/template/handlebars" "github.com/gofiber/template/handlebars"
"github.com/spf13/viper" "github.com/spf13/viper"
) )
@@ -39,6 +40,7 @@ func main() {
StreamRequestBody: true, StreamRequestBody: true,
}) })
app.Use(recover.New())
app.Use("/static", filesystem.New(filesystem.Config{ app.Use("/static", filesystem.New(filesystem.Config{
Root: http.FS(static.GetFiles()), Root: http.FS(static.GetFiles()),
})) }))