aboutsummaryrefslogtreecommitdiff
path: root/internal/router/router.go
diff options
context:
space:
mode:
authorraul-te <46945030+raul-te@users.noreply.github.com>2020-04-01 10:41:17 -0700
committerGitHub <noreply@github.com>2020-04-01 10:41:17 -0700
commitb709a777f56511e233cd4652e73ec46c7641652b (patch)
tree0acfa9bef4458aee5d04dd87535b4473c096eac4 /internal/router/router.go
parenta21d894fb128e49d6ef912bbed51bfb0754223fa (diff)
parent5f2ba83e131c5a67f979abb909fecb59651c44ac (diff)
Merge pull request #6 from rul/support-config-subdirectories
Support config subdirectories
Diffstat (limited to 'internal/router/router.go')
-rw-r--r--internal/router/router.go4
1 files changed, 3 insertions, 1 deletions
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
nihil fit ex nihilo