From 122651677f5c7d71e14497971c060812321a5dc0 Mon Sep 17 00:00:00 2001 From: kalipso Date: Fri, 11 Apr 2025 18:17:33 +0200 Subject: [PATCH] set views by env --- flake.nix | 1 + main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 5974a08..3e0e180 100644 --- a/flake.nix +++ b/flake.nix @@ -89,6 +89,7 @@ SECRET = "secretforjwt"; #TODO: BAD! PORT = "8080"; STATIC = "/var/lib/zineshop/static"; + VIEWS = "/var/lib/zineshop/views"; }; preStart = '' diff --git a/main.go b/main.go index 7c75f77..73f9215 100644 --- a/main.go +++ b/main.go @@ -53,7 +53,7 @@ func main() { server.Use(gin.Logger()) server.Static("/static", os.Getenv("STATIC")) - server.LoadHTMLGlob("views/*.html") + server.LoadHTMLGlob(fmt.Sprintf("%s/*.html", os.Getenv("VIEWS"))) apiRoutes := server.Group("/api") //apiRoutes.Use(middlewares.BasicAuth())