From b0c1ce813e9a87c7a9d9b86c3b02385b6dea9a22 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Fri, 23 Jan 2026 19:23:48 +0800 Subject: [PATCH] update cmd/accountsvc/main.go --- cmd/accountsvc/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/accountsvc/main.go b/cmd/accountsvc/main.go index a2c36c7..ba929ca 100644 --- a/cmd/accountsvc/main.go +++ b/cmd/accountsvc/main.go @@ -256,6 +256,9 @@ func runServer(ctx context.Context, cfg *config.Config, logger *slog.Logger) err if addr == "" { addr = ":8080" } + if port := strings.TrimSpace(os.Getenv("PORT")); port != "" { + addr = "0.0.0.0:" + port + } tlsSettings := cfg.Server.TLS certFile := strings.TrimSpace(tlsSettings.CertFile)