Minumum Working Example

This commit is contained in:
Simon Martens
2026-02-20 14:53:05 +01:00
parent 8f5338c0b8
commit 5a00333266
8 changed files with 1169 additions and 6 deletions

View File

@@ -1,11 +1,23 @@
package server
import (
"io/fs"
"github.com/Theodor-Springmann-Stiftung/lenz-web/templates"
"github.com/labstack/echo/v5"
)
// INFO: Static files here:
func MapStatic(e *echo.Echo) {
e.StaticFS("/public", templates.PublicFS)
publicFS, err := fs.Sub(templates.PublicFS, "public")
if err != nil {
// fallback keeps server running even if FS layout changes unexpectedly
e.StaticFS("/public", templates.PublicFS)
return
}
e.StaticFS("/public", publicFS)
}
func MapEndpoints(e *echo.Echo, s *Server) {
e.GET("/brief/:number", s.Brief)
}