diff --git a/Dockerfile b/Dockerfile index c22b025..a2d3898 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM golang:1.21-alpine AS go-builder WORKDIR /usr/src/app # 安装必要的构建工具 -# RUN apk add --no-cache gcc musl-dev +RUN apk add --no-cache gcc musl-dev # 设置 GOPROXY 环境变量 ENV GOPROXY=https://goproxy.cn,direct diff --git a/main.go b/main.go index fce96da..b5b4b9a 100644 --- a/main.go +++ b/main.go @@ -74,6 +74,20 @@ func main() { router.POST("/speech/synthesize", llmHandler.SynthesizeSpeech) router.GET("/stream-text", llmHandler.StreamText) router.POST("/token", tokenHandler.GenerateToken) + // Define routes + router.GET("/", func(c *gin.Context) { + c.JSON(200, gin.H{ + "status": "ok", + "message": "Service is healthy", + }) + }) + // Define routes + router.GET("/health", func(c *gin.Context) { + c.JSON(200, gin.H{ + "status": "ok", + "message": "Service is healthy", + }) + }) // Serve static files router.Static("/static", "./static")