aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/middleware.go
blob: 56d4797d60c77c635544dc7b3bd2917b95409d3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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()
	})
}