feat: translation middleware
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package handlehome
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.schreifuchs.ch/schreifuchs/schreifuchs.ch/internal/components/page"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
src pageService
|
||||
}
|
||||
|
||||
func New(mux *http.ServeMux, srv pageService) *Handler {
|
||||
h := &Handler{
|
||||
src: srv,
|
||||
}
|
||||
|
||||
mux.HandleFunc("GET /{$}", h.home)
|
||||
mux.HandleFunc("GET /{uid}", h.page)
|
||||
return h
|
||||
}
|
||||
|
||||
type pageService interface {
|
||||
GetPages() ([]page.Page, error)
|
||||
}
|
||||
Reference in New Issue
Block a user