jenkins
This commit is contained in:
@@ -36,7 +36,11 @@ func NewGinEngineWithRuntime(runtime *config.Store, access *systemservice.Access
|
||||
prefix = strings.TrimSuffix(snapshot.Admin.RouterPrefix, "/")
|
||||
}
|
||||
public := engine.Group(prefix)
|
||||
public.GET("/health", func(c *gin.Context) { c.JSON(http.StatusOK, "ok") })
|
||||
health := func(c *gin.Context) { c.JSON(http.StatusOK, "ok") }
|
||||
engine.GET("/health", health)
|
||||
if prefix != "" {
|
||||
public.GET("/health", health)
|
||||
}
|
||||
|
||||
private := engine.Group(prefix)
|
||||
// The reference administration behavior installs operation recording after JWT,
|
||||
@@ -103,11 +107,11 @@ func NewGinEngineWithRuntime(runtime *config.Store, access *systemservice.Access
|
||||
}
|
||||
}
|
||||
if ws != nil && ws.Enabled() {
|
||||
engine.GET(ws.Path(), handleWebSocket)
|
||||
engine.GET(websocketRoutePath(prefix, ws), handleWebSocket)
|
||||
}
|
||||
if logger != nil {
|
||||
logger.Info("websocket endpoint initialized", "mod", "websocket",
|
||||
"enabled", ws != nil && ws.Enabled(), "path", websocketPath(ws))
|
||||
"enabled", ws != nil && ws.Enabled(), "path", websocketRoutePath(prefix, ws))
|
||||
}
|
||||
env := ""
|
||||
if snapshot != nil && snapshot.Admin != nil && snapshot.Admin.App != nil {
|
||||
@@ -125,10 +129,6 @@ func NewGinEngineWithRuntime(runtime *config.Store, access *systemservice.Access
|
||||
}
|
||||
|
||||
engine.NoRoute(func(c *gin.Context) {
|
||||
if ws != nil && ws.Enabled() && c.Request.Method == http.MethodGet && c.Request.URL.Path == websocketRoutePath(prefix, ws) {
|
||||
handleWebSocket(c)
|
||||
return
|
||||
}
|
||||
if staticfiles.Serve(c, runtime) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user