Skip to content

Commit 107f4f9

Browse files
committed
feat(server): add connection URL response and logging middleware
- Add direct URL response for running connections - Enable gin logging middleware for better request tracking - Improve connection status handling
1 parent 4d3bc2d commit 107f4f9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

internal/server/router/connection.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ func (cr *ConnectionRouter) Get(ctx *gin.Context) {
3535
return
3636
}
3737

38+
if conn.Status.Phase == tfv1.TensorFusionConnectionRunning {
39+
ctx.JSON(200, conn.Status.ConnectionURL)
40+
return
41+
}
42+
3843
// Subscribe to connection updates
3944
ch, cancelFunc := cr.watcher.subscribe(req)
4045
defer cancelFunc()

internal/server/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import (
99
func NewHTTPServer(
1010
cr *router.ConnectionRouter,
1111
) *gin.Engine {
12+
1213
r := gin.New()
1314
r.Use(gzip.Gzip(gzip.DefaultCompression))
1415
r.Use(gin.Recovery())
16+
r.Use(gin.Logger())
1517

1618
apiGroup := r.Group("/api")
1719
apiGroup.GET("/connection", cr.Get)

0 commit comments

Comments
 (0)