mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2026-03-21 05:45:32 +00:00
26 lines
554 B
Go
26 lines
554 B
Go
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) {
|
|
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("/", s.Home)
|
|
e.GET("/briefe", s.Home)
|
|
e.GET("/brief/:number", s.Brief)
|
|
}
|