mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-30 12:20:33 +00:00
simplify routes (#437)
This commit is contained in:
parent
72aa979644
commit
fd9448cad7
2 changed files with 6 additions and 21 deletions
|
@ -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")
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue