mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-29 01:05:32 +00:00
Public Lib
This commit is contained in:
18
helpers/middleware/static.go
Normal file
18
helpers/middleware/static.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"net/http"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
||||
)
|
||||
|
||||
func StaticHandler(fs *fs.FS) fiber.Handler {
|
||||
return filesystem.New(filesystem.Config{
|
||||
Root: http.FS(*fs),
|
||||
Browse: false,
|
||||
Index: "index.html",
|
||||
MaxAge: 3600,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user