Converting pages to templates

This commit is contained in:
Muyao CHEN
2024-06-29 21:30:06 +02:00
parent b3eb96845a
commit 0ca6de59fd
18 changed files with 474 additions and 906 deletions

View File

@ -34,7 +34,7 @@ func main() {
tc, err := render.CreateTemplateCache()
if err != nil {
log.Fatal("cannot create template cache")
log.Fatalf("cannot create template cache: %s", err)
}
app.TemplateCahce = tc
app.UseCache = false

View File

@ -19,6 +19,11 @@ func routes(app *config.AppConfig) http.Handler {
mux.Get("/", handlers.Repo.Home)
mux.Get("/about", handlers.Repo.About)
mux.Get("/contact", handlers.Repo.Contact)
mux.Get("/generals-quarters", handlers.Repo.Generals)
mux.Get("/majors-suite", handlers.Repo.Majors)
mux.Get("/reservation", handlers.Repo.Reservation)
mux.Get("/make-reservation", handlers.Repo.MakeReservation)
fileServer := http.FileServer(http.Dir("./static/"))
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))