TODO - This function is where your pages are loaded.
(router *http.ServeMux, tmpl *template.Template)
| 15 | |
| 16 | // TODO - This function is where your pages are loaded. |
| 17 | func (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 | |
| 27 | func (a *App) loadRoutes() (http.Handler, error) { |
| 28 | tmpl, err := template.New("").ParseFS(a.files, "templates/*") |
no test coverage detected