feat: remove API documentation tab and update README for deployment instructions
This commit is contained in:
@@ -47,24 +47,3 @@ func (h *PagesHandler) HandleIndex(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// HandleAPIDoc 处理API文档请求
|
||||
func (h *PagesHandler) HandleAPIDoc(c *gin.Context) {
|
||||
// 准备模板数据
|
||||
data := map[string]interface{}{
|
||||
"BasePath": h.config.Server.BasePath,
|
||||
"DefaultVoice": h.config.TTS.DefaultVoice,
|
||||
"DefaultRate": h.config.TTS.DefaultRate,
|
||||
"DefaultPitch": h.config.TTS.DefaultPitch,
|
||||
"DefaultFormat": h.config.TTS.DefaultFormat,
|
||||
}
|
||||
|
||||
// 设置内容类型
|
||||
c.Header("Content-Type", "text/html; charset=utf-8")
|
||||
|
||||
// 渲染模板
|
||||
if err := h.templates.ExecuteTemplate(c.Writer, "api-doc.html", data); err != nil {
|
||||
c.AbortWithStatusJSON(500, gin.H{"error": "模板渲染失败: " + err.Error()})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,9 +43,6 @@ func SetupRoutes(cfg *config.Config, ttsService tts.Service) (*gin.Engine, error
|
||||
// 设置主页路由
|
||||
baseRouter.GET("/", pagesHandler.HandleIndex)
|
||||
|
||||
// 设置API文档路由
|
||||
baseRouter.GET("/api-doc", pagesHandler.HandleAPIDoc)
|
||||
|
||||
// 设置TTS API路由 - 添加认证中间件
|
||||
|
||||
baseRouter.POST("/tts", middleware.TTSAuth(cfg.TTS.ApiKey), ttsHandler.HandleTTS)
|
||||
|
||||
Reference in New Issue
Block a user