fix: env file mismatch.

fix: add template for setting up env
This commit is contained in:
joyHuang 2026-05-15 23:04:04 +09:00
parent 71d9104083
commit fd84e92cbe
Signed by: joy
GPG Key ID: E9FF7B8ECF17FD6D
3 changed files with 7 additions and 6 deletions

2
.env
View File

@ -1,2 +0,0 @@
debug=true
port=1231

2
.example.env Normal file
View File

@ -0,0 +1,2 @@
DEBUG=false
PORT=1231

View File

@ -2,10 +2,11 @@ package main
import (
"NTU-H/utils/system"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"io"
"os"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
)
func main() {
@ -14,7 +15,7 @@ func main() {
panic(env)
}
debug := os.Getenv("DEBUG")
if debug != "true" {
if debug != "false" {
gin.SetMode(gin.ReleaseMode)
gin.DefaultWriter = io.Discard
}
@ -25,7 +26,7 @@ func main() {
route := gin.Default()
route.Use(
gin.Recovery(),
//gin.Logger(),
gin.Logger(),
)
route.Group("/api/v1").POST("/speech", func(c *gin.Context) {
log.Print(1, "speech")