From a9930c02a33fe94141cd651212b5a815095c77ba Mon Sep 17 00:00:00 2001 From: Emile Date: Fri, 16 Aug 2024 22:40:26 +0200 Subject: make template path configurable --- src/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.go') diff --git a/src/main.go b/src/main.go index 22e5eb7..941b58e 100644 --- a/src/main.go +++ b/src/main.go @@ -15,6 +15,7 @@ var port int var logFilePath string var databasePath string var sessiondbPath string +var templatesPath string const salt = "oogha3AiH7taimohreeH8Lexoonea5zi" @@ -32,6 +33,7 @@ func initFlags() { flag.StringVar(&logFilePath, "logfilepath", "./server.log", "The path to the log file") flag.StringVar(&databasePath, "databasepath", "./main.db", "The path to the main database") flag.StringVar(&sessiondbPath, "sessiondbpath", "./sesions.db", "The path to the session database") + flag.StringVar(&sessiondbPath, "sessiondbpath", "./templates", "The path to the templates used") } func main() { @@ -71,7 +73,7 @@ func main() { r.HandleFunc("/", indexHandler) r.HandleFunc("/login", loginHandler) r.HandleFunc("/register", registerHandler) - r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static")))) + // r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static")))) // endpoints with auth needed auth_needed := r.PathPrefix("/").Subrouter() -- cgit 1.4.1