set views by env

This commit is contained in:
2025-04-11 18:17:33 +02:00
parent af11f88769
commit 122651677f
2 changed files with 2 additions and 1 deletions

View File

@@ -89,6 +89,7 @@
SECRET = "secretforjwt"; #TODO: BAD! SECRET = "secretforjwt"; #TODO: BAD!
PORT = "8080"; PORT = "8080";
STATIC = "/var/lib/zineshop/static"; STATIC = "/var/lib/zineshop/static";
VIEWS = "/var/lib/zineshop/views";
}; };
preStart = '' preStart = ''

View File

@@ -53,7 +53,7 @@ func main() {
server.Use(gin.Logger()) server.Use(gin.Logger())
server.Static("/static", os.Getenv("STATIC")) server.Static("/static", os.Getenv("STATIC"))
server.LoadHTMLGlob("views/*.html") server.LoadHTMLGlob(fmt.Sprintf("%s/*.html", os.Getenv("VIEWS")))
apiRoutes := server.Group("/api") apiRoutes := server.Group("/api")
//apiRoutes.Use(middlewares.BasicAuth()) //apiRoutes.Use(middlewares.BasicAuth())