添加文件: xy_sh/cmd/server/main.go

This commit is contained in:
renzhiyuan 2026-07-24 11:54:41 +08:00
parent 6526404b5c
commit c693f3961c
1 changed files with 18 additions and 0 deletions

18
xy_sh/cmd/server/main.go Normal file
View File

@ -0,0 +1,18 @@
package main
import (
"log"
"xy_sh/internal/config"
"xy_sh/internal/router"
)
func main() {
cfg := config.LoadConfig()
app := router.SetupRouter(cfg)
log.Printf("服务启动,监听端口: %s", cfg.ServerPort)
if err := app.Listen(":" + cfg.ServerPort); err != nil {
log.Fatalf("服务启动失败: %v", err)
}
}