feat: port config; print docx link.

This commit is contained in:
2026-05-04 22:28:25 +08:00
parent 30c8094f0f
commit 85f28b5660
2 changed files with 21 additions and 1 deletions
+16 -1
View File
@@ -84,5 +84,20 @@ func main() {
// 启动服务
r := routes.SetupRouter()
r.Run(":8081")
port := config.App.Server.Port
if port == "" {
port = ":8081"
} else if port[0] != ':' {
port = ":" + port
}
if config.App.Swagger.Enabled {
host := "localhost"
addr := host + port
log.Printf("Swagger UI: http://%s/swagger/index.html", addr)
log.Printf("Scalar 文档: http://%s/scalar", addr)
}
r.Run(port)
}