From 5f2ba83e131c5a67f979abb909fecb59651c44ac Mon Sep 17 00:00:00 2001
From: Raul Benencia <rul@kalgan.cc>
Date: Wed, 1 Apr 2020 10:09:26 -0700
Subject: Support config subdirectories

---
 internal/router/router.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'internal/router')

diff --git a/internal/router/router.go b/internal/router/router.go
index abe4f8b..d729d16 100644
--- a/internal/router/router.go
+++ b/internal/router/router.go
@@ -48,8 +48,10 @@ func ShoelacesRouter(env *environment.Environment) http.Handler {
 	// Static configuration files endpoint
 	r.PathPrefix("/configs/static/").Handler(http.StripPrefix("/configs/static/",
 		handlers.StaticConfigFileServer()))
+
 	// Dynamic configuration endpoint
-	r.HandleFunc("/configs/{key}", handlers.TemplateHandler).Methods("GET")
+	r.PathPrefix("/configs/").Handler(http.StripPrefix("/configs/",
+		handlers.TemplateServer()))
 
 	// Called by iPXE boot agents, returns boot script specified on the configuration
 	// or if the host is unknown makes it retry for a while until the user specifies
-- 
cgit v1.2.3