fix port env

This commit is contained in:
sirir 2025-03-25 20:48:47 +01:00
parent ac3b99d0bd
commit 1946692f17

View File

@ -5,13 +5,17 @@ import (
"backea/internal/server"
"log"
"os"
"github.com/joho/godotenv"
)
func main() {
// Get port from environment or use default
if err := godotenv.Load(); err != nil {
log.Printf("Warning: .env file not found or could not be loaded: %v", err)
}
port := os.Getenv("PORT")
if port == "" {
port = "8080"
port = "21311"
}
// Create backup factory