NTU-Hospital/main.go

39 lines
582 B
Go

package main
import (
"NTU-H/utils/system"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"io"
"os"
)
func main() {
env := godotenv.Load()
if env != nil {
panic(env)
}
debug := os.Getenv("DEBUG")
if debug != "true" {
gin.SetMode(gin.ReleaseMode)
gin.DefaultWriter = io.Discard
}
log := system.NewLogModel()
log.Startup()
route := gin.Default()
route.Use(
gin.Recovery(),
//gin.Logger(),
)
route.Group("/api/v1").POST("/speech", func(c *gin.Context) {
log.Print(1, "speech")
})
err := route.Run(":" + "1231")
if err != nil {
return
}
}