fix port env
This commit is contained in:
parent
ac3b99d0bd
commit
1946692f17
@ -5,13 +5,17 @@ import (
|
|||||||
"backea/internal/server"
|
"backea/internal/server"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/joho/godotenv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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")
|
port := os.Getenv("PORT")
|
||||||
if port == "" {
|
if port == "" {
|
||||||
port = "8080"
|
port = "21311"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create backup factory
|
// Create backup factory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user