mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-24 08:02:18 +02:00
simplify routes (#437)
This commit is contained in:
parent
72aa979644
commit
fd9448cad7
@ -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 New Issue
Block a user