From c693f3961cb6d0033c3545743619a8a8d6a1ec7c Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Fri, 24 Jul 2026 11:54:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6:=20xy=5Fsh?= =?UTF-8?q?/cmd/server/main.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xy_sh/cmd/server/main.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 xy_sh/cmd/server/main.go diff --git a/xy_sh/cmd/server/main.go b/xy_sh/cmd/server/main.go new file mode 100644 index 0000000..af4bb91 --- /dev/null +++ b/xy_sh/cmd/server/main.go @@ -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) + } +} \ No newline at end of file