set views by env
This commit is contained in:
@@ -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 = ''
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -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())
|
||||||
|
|||||||
Reference in New Issue
Block a user