initial commit

This commit is contained in:
zuoban
2024-04-17 14:14:19 +08:00
commit f2455f92b6
14 changed files with 555 additions and 0 deletions

20
routes/routes.go Normal file
View File

@@ -0,0 +1,20 @@
package routes
import (
"github.com/gin-gonic/gin"
"tts/handlers"
)
func SetupRouter() *gin.Engine {
router := gin.Default()
// 加载模板文件
router.LoadHTMLGlob("templates/*")
router.GET("/voices", handlers.GetVoiceList)
router.POST("/tts", handlers.SynthesizeVoicePost)
router.GET("/tts", handlers.SynthesizeVoice)
router.GET("/", handlers.Index)
return router
}