mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-29 01:05:32 +00:00
Cache Settings for DEV mode
This commit is contained in:
@@ -4,15 +4,16 @@ import (
|
||||
"io/fs"
|
||||
"net/http"
|
||||
|
||||
"github.com/Theodor-Springmann-Stiftung/lenz-web/helpers/middleware/filesystem"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
||||
)
|
||||
|
||||
func StaticHandler(fs *fs.FS) fiber.Handler {
|
||||
func StaticHandler(fs *fs.FS, dev bool) fiber.Handler {
|
||||
return filesystem.New(filesystem.Config{
|
||||
Root: http.FS(*fs),
|
||||
Browse: false,
|
||||
Index: "index.html",
|
||||
Dev: dev,
|
||||
MaxAge: 3600,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user