aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/middleware.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/middleware.go')
-rw-r--r--internal/admin/middleware.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/admin/middleware.go b/internal/admin/middleware.go
new file mode 100644
index 0000000..56d4797
--- /dev/null
+++ b/internal/admin/middleware.go
@@ -0,0 +1,15 @@
+package admin
+
+import (
+ "log"
+ "net/http"
+)
+
+// Admin middleware to handle requests to the admin repo.
+func AdminHooks(adminSvc *Servicer, next http.Handler) http.Handler {
+ return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
+ log.Printf("stuffs about to reload %s", "now")
+ next.ServeHTTP(rw, req)
+ go adminSvc.Reload()
+ })
+}