|
|
|
@ -12,7 +12,6 @@ import (
|
|
|
|
|
"forge.chapril.org/dune/sdk" |
|
|
|
|
"forge.chapril.org/losyme/kong/context" |
|
|
|
|
"forge.chapril.org/losyme/kong/middleware" |
|
|
|
|
"forge.chapril.org/losyme/kong/middleware/json" |
|
|
|
|
"forge.chapril.org/losyme/kong/router" |
|
|
|
|
"forge.chapril.org/losyme/logger" |
|
|
|
|
"forge.chapril.org/losyme/uuid" |
|
|
|
@ -34,15 +33,10 @@ func Build(cs *components.Components) (*API, error) {
|
|
|
|
|
|
|
|
|
|
csr := cs.Router |
|
|
|
|
|
|
|
|
|
csr.MethodNotAllowed = json.MethodNotAllowed(logger) |
|
|
|
|
csr.NotFound = json.NotFound(logger) |
|
|
|
|
csr.OnRecover = json.OnRecover(logger) |
|
|
|
|
|
|
|
|
|
csr.Use( |
|
|
|
|
middleware.RequestID(), |
|
|
|
|
middleware.Logger(logger), |
|
|
|
|
json.OnError(logger), |
|
|
|
|
json.BasicAuth(cs.Crypto), |
|
|
|
|
middleware.BasicAuth(cs.Crypto), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
api := &API{ |
|
|
|
@ -64,7 +58,8 @@ func Build(cs *components.Components) (*API, error) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (api *API) status(c *context.Context) error { |
|
|
|
|
return c.JSON(http.StatusNoContent, nil) |
|
|
|
|
c.RenderStatusNoContent() |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (api *API) dashboard(c *context.Context) error { |
|
|
|
@ -73,7 +68,7 @@ func (api *API) dashboard(c *context.Context) error {
|
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return c.JSON(http.StatusOK, stats) |
|
|
|
|
return c.Render(http.StatusOK, stats) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|