mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2026-03-21 13:55:30 +00:00
Minumum Working Example
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user