From f5f003298e27176000db971de034df8e490e8fc0 Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Sun, 8 Oct 2023 16:44:41 +0100 Subject: [PATCH] Load tempaltes on startup --- cmd/lavender/serve.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/lavender/serve.go b/cmd/lavender/serve.go index 881d222..a1c6db7 100644 --- a/cmd/lavender/serve.go +++ b/cmd/lavender/serve.go @@ -6,6 +6,7 @@ import ( "encoding/json" "flag" "github.com/1f349/lavender/server" + "github.com/1f349/lavender/server/pages" "github.com/1f349/violet/utils" exit_reload "github.com/MrMelon54/exit-reload" "github.com/MrMelon54/mjwt" @@ -71,6 +72,11 @@ func normalLoad(startUp server.Conf, wd string) { log.Fatal("[Lavender] Failed to load or create MJWT signer:", err) } + err = pages.LoadPages(wd) + if err != nil { + log.Fatal("[Lavender] Failed to load page templates:", err) + } + srv := server.NewHttpServer(startUp, mSign) log.Printf("[Lavender] Starting HTTP server on '%s'\n", srv.Addr) go utils.RunBackgroundHttp("HTTP", srv)