aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/middleware.go
blob: 8b88c83715c78ee778dc9fa42c7bae46f5e93278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package admin

import (
	"net/http"
)

// Hooks middleware to handle requests to the admin repo.
func Hooks(adminSvc *Servicer, next http.Handler) http.Handler {
	return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
		go adminSvc.Reload()
		next.ServeHTTP(rw, req)
	})
}