summaryrefslogtreecommitdiffstats
path: root/cmd/web/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/main.go')
-rw-r--r--cmd/web/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/web/main.go b/cmd/web/main.go
index 7e25124..f0632a5 100644
--- a/cmd/web/main.go
+++ b/cmd/web/main.go
@@ -3,6 +3,7 @@ package main
import (
"database/sql"
"flag"
+ "html/template"
"log/slog"
"net/http"
"os"
@@ -16,6 +17,7 @@ type application struct {
operations *models.OperationModel
organisations *models.OrganisationModel
engagement_strategies *models.EngagementStrategyModel
+ templateCache map[string]*template.Template
}
func main() {
@@ -34,11 +36,19 @@ func main() {
defer db.Close()
+ // initialise the new template cache...
+ templateCache, err := newTemplateCache()
+ if err != nil {
+ logger.Error(err.Error())
+ os.Exit(1)
+ }
+
app := &application{
logger: logger,
operations: &models.OperationModel{DB: db},
organisations: &models.OrganisationModel{DB: db},
engagement_strategies: &models.EngagementStrategyModel{DB: db},
+ templateCache: templateCache,
}
// mux := http.NewServeMux()