Decoupling server / engine / kgpz

This commit is contained in:
Simon Martens
2025-01-09 02:41:03 +01:00
parent a62a09b258
commit f998ce61c6
11 changed files with 189 additions and 94 deletions

18
helpers/serverhelpers.go Normal file
View File

@@ -0,0 +1,18 @@
package helpers
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,
})
}