This commit is contained in:
Yanislav Igonin 2022-04-06 12:52:34 +03:00
parent 34c144b571
commit 7dedbf1d98

12
main.go
View File

@ -56,17 +56,15 @@ func main() {
engine := html.New("./templates", ".html") engine := html.New("./templates", ".html")
engine.AddFunc("Iterate", templates.Iterate) engine.AddFunc("Iterate", templates.Iterate)
engine.AddFunc("NotNil", templates.NotNil) engine.AddFunc("NotNil", templates.NotNil)
app := fiber.New(fiber.Config{
Views: engine, app := fiber.New(fiber.Config{Views: engine})
})
app.Use(limiter.New(limiter.Config{ app.Use(limiter.New(limiter.Config{
// skip on localhost Next: func(c *fiber.Ctx) bool { return c.IP() == "127.0.0.1" },
Next: func(c *fiber.Ctx) bool {
return c.IP() == "127.0.0.1"
},
})) }))
app.Use(compress.New()) app.Use(compress.New())
app.Use(etag.New()) app.Use(etag.New())
app.Static("/uploads", "./uploads") app.Static("/uploads", "./uploads")
app.Static("/static", "./static") app.Static("/static", "./static")