fix agent connect

This commit is contained in:
naiba
2024-10-22 23:44:50 +08:00
parent f99edfd7bd
commit c4011934f7
7 changed files with 60 additions and 64 deletions

View File

@@ -23,7 +23,7 @@ import (
"github.com/naiba/nezha/service/singleton"
)
func ServeWeb() *http.Server {
func ServeWeb() http.Handler {
gin.SetMode(gin.ReleaseMode)
r := gin.Default()
docs.SwaggerInfo.BasePath = "/api/v1"
@@ -39,10 +39,7 @@ func ServeWeb() *http.Server {
r.Use(recordPath)
routers(r)
return &http.Server{
ReadHeaderTimeout: time.Second * 5,
Handler: r,
}
return r
}
func routers(r *gin.Engine) {