From a2994f390556c7226b168a85224077acfc616d1b Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Sun, 28 Sep 2025 10:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- main.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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")