about summary refs log tree commit diff
path: root/src/main.go
diff options
context:
space:
mode:
authorEmile <git@emile.space>2024-08-16 22:40:26 +0200
committerEmile <git@emile.space>2024-08-16 22:40:26 +0200
commita9930c02a33fe94141cd651212b5a815095c77ba (patch)
tree4027ea61b0cb6925604cffa56eb8a717ee3c0e0d /src/main.go
parent294659add1082f4a2333871f2a45fe0ec22fa2a7 (diff)
make template path configurable
Diffstat (limited to 'src/main.go')
-rw-r--r--src/main.go4
1 files changed, 3 insertions, 1 deletions
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()