u
This commit is contained in:
1 parent
9e00adf2fe
commit
ae0d245605
34 files changed
+1460
-162
No files matched your search
@@ -1,26 +1,21 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"allapp-go-v2/internal/bootstrap"
|
||||
"fmt"
|
||||
"allapp-go-v2/internal/config"
|
||||
"log"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
"github.com/gofiber/fiber/v3/middleware/requestid"
|
||||
)
|
||||
|
||||
func Start(appCtx *bootstrap.App) error {
|
||||
// 1️⃣ 创建 fiber 实例
|
||||
func Run(cfg *config.Config) error {
|
||||
app := fiber.New()
|
||||
|
||||
app.Use(requestid.New())
|
||||
// 注册路由
|
||||
//registerRoutes(app)
|
||||
|
||||
// 2️⃣ 注册路由
|
||||
//registerRoutes(app, appCtx)
|
||||
port := cfg.Server.Port
|
||||
|
||||
// 3️⃣ 启动服务
|
||||
addr := fmt.Sprintf(":%s", appCtx.Config.Server.Port)
|
||||
log.Println("🚀 server start on :" + port)
|
||||
|
||||
fmt.Println("🚀 server running at", addr)
|
||||
|
||||
return app.Listen(addr)
|
||||
return app.Listen(":" + port)
|
||||
}
|
||||
Reference in new issue
Block a user