diff --git a/api.go b/api.go index 4c5b320c..ed8eeb07 100644 --- a/api.go +++ b/api.go @@ -35,7 +35,7 @@ type API struct { context func(r *http.Request) context.Context } -func NewAPI(r *route.Router, alerts provider.Alerts, silences provider.Silences) *API { +func RegisterAPI(r *route.Router, alerts provider.Alerts, silences provider.Silences) *API { api := &API{ context: route.Context, alerts: alerts, diff --git a/main.go b/main.go index b98b4776..04b7acbd 100644 --- a/main.go +++ b/main.go @@ -126,7 +126,7 @@ func main() { } router := route.New() - NewAPI(router.WithPrefix("/api/v1"), alerts, silences) + RegisterAPI(router.WithPrefix("/api/v1"), alerts, silences) go http.ListenAndServe(*listenAddress, router)