mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-29 01:05:32 +00:00
20 lines
366 B
Go
20 lines
366 B
Go
package middleware
|
|
|
|
import (
|
|
"io/fs"
|
|
"net/http"
|
|
|
|
"github.com/Theodor-Springmann-Stiftung/lenz-web/helpers/middleware/filesystem"
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
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,
|
|
})
|
|
}
|