blob: 958ca305c7457832d883795bf81a3c68776146f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package handlers
import (
"html/template"
"net/http"
"codeberg.org/mihna123/openstore/internal/config"
"codeberg.org/mihna123/openstore/internal/web"
)
type Handler struct {
tmpl *template.Template
cfg *config.Config
}
func Routes(conf *config.Config) *http.ServeMux {
handler := Handler{
tmpl: template.Must(template.ParseFS(web.Files, "templates/*.html")),
cfg: conf,
}
mux := http.NewServeMux()
mux.HandleFunc("GET /{$}", handler.home)
return mux
}
|