diff options
author | Raul Benencia <rul@kalgan.cc> | 2020-04-01 10:09:26 -0700 |
---|---|---|
committer | Raul Benencia <rul@kalgan.cc> | 2020-04-01 10:11:46 -0700 |
commit | 5f2ba83e131c5a67f979abb909fecb59651c44ac (patch) | |
tree | 0acfa9bef4458aee5d04dd87535b4473c096eac4 /internal/router | |
parent | a21d894fb128e49d6ef912bbed51bfb0754223fa (diff) |
Support config subdirectories
Diffstat (limited to 'internal/router')
-rw-r--r-- | internal/router/router.go | 4 |
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 |