simplify routes (#437)

This commit is contained in:
Anbraten 2021-10-13 18:36:11 +02:00 committed by GitHub
parent 72aa979644
commit fd9448cad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 21 deletions

View file

@ -113,22 +113,11 @@ func apiRoutes(e *gin.Engine) {
queue := e.Group("/api/queue")
{
queue.GET("/info",
session.MustAdmin(),
api.GetQueueInfo,
)
queue.GET("/pause",
session.MustAdmin(),
api.PauseQueue,
)
queue.GET("/resume",
session.MustAdmin(),
api.ResumeQueue,
)
queue.GET("/norunningbuilds",
session.MustAdmin(),
api.BlockTilQueueHasRunningItem,
)
queue.Use(session.MustAdmin())
queue.GET("/info", api.GetQueueInfo)
queue.GET("/pause", api.PauseQueue)
queue.GET("/resume", api.ResumeQueue)
queue.GET("/norunningbuilds", api.BlockTilQueueHasRunningItem)
}
debugger := e.Group("/api/debug")

View file

@ -67,11 +67,7 @@ func Load(serveHTTP func(w http.ResponseWriter, r *http.Request), middleware ...
auth.POST("/token", api.GetLoginToken)
}
monitor := e.Group("/metrics")
{
monitor.GET("", metrics.PromHandler())
}
e.GET("/metrics", metrics.PromHandler())
e.GET("/version", api.Version)
e.GET("/healthz", api.Health)