MCPcopy Index your code
hub / github.com/dreamsofcode-io/zenstats / loadPages

Method loadPages

internal/app/routes.go:17–25  ·  view source on GitHub ↗

TODO - This function is where your pages are loaded.

(router *http.ServeMux, tmpl *template.Template)

Source from the content-addressed store, hash-verified

15
16// TODO - This function is where your pages are loaded.
17func (a *App) loadPages(router *http.ServeMux, tmpl *template.Template) {
18 repo := repository.New(a.db)
19
20 h := handler.NewIndex(a.logger, a.quotes, tmpl, repo)
21
22 // This is your index route, i.e. /. It has an odd syntax in
23 // the go serve mux
24 router.Handle("GET /{$}", h)
25}
26
27func (a *App) loadRoutes() (http.Handler, error) {
28 tmpl, err := template.New("").ParseFS(a.files, "templates/*")

Callers 1

loadRoutesMethod · 0.95

Calls 2

NewFunction · 0.92
NewIndexFunction · 0.92

Tested by

no test coverage detected