add allow registration to API Summary

This commit is contained in:
Hayden 2023-02-15 08:53:43 -09:00
parent 607b06d2f2
commit 22bee7b406
No known key found for this signature in database
GPG key ID: 17CF79474E257545

View file

@ -44,12 +44,13 @@ type (
} }
ApiSummary struct { ApiSummary struct {
Healthy bool `json:"health"` Healthy bool `json:"health"`
Versions []string `json:"versions"` Versions []string `json:"versions"`
Title string `json:"title"` Title string `json:"title"`
Message string `json:"message"` Message string `json:"message"`
Build Build `json:"build"` Build Build `json:"build"`
Demo bool `json:"demo"` Demo bool `json:"demo"`
AllowRegistration bool `json:"allowRegistration"`
} }
) )
@ -82,11 +83,12 @@ func NewControllerV1(svc *services.AllServices, repos *repo.AllRepos, options ..
func (ctrl *V1Controller) HandleBase(ready ReadyFunc, build Build) server.HandlerFunc { func (ctrl *V1Controller) HandleBase(ready ReadyFunc, build Build) server.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) error { return func(w http.ResponseWriter, r *http.Request) error {
return server.Respond(w, http.StatusOK, ApiSummary{ return server.Respond(w, http.StatusOK, ApiSummary{
Healthy: ready(), Healthy: ready(),
Title: "Go API Template", Title: "Go API Template",
Message: "Welcome to the Go API Template Application!", Message: "Welcome to the Go API Template Application!",
Build: build, Build: build,
Demo: ctrl.isDemo, Demo: ctrl.isDemo,
AllowRegistration: ctrl.allowRegistration,
}) })
} }
} }