Public Lib

This commit is contained in:
Simon Martens
2025-03-23 21:19:12 +01:00
parent 52382a00e2
commit 66fedf4baf
7 changed files with 427 additions and 43 deletions

View 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,
})
}