changes
This commit is contained in:
13
main.go
13
main.go
@@ -255,8 +255,19 @@ func main() {
|
||||
}
|
||||
|
||||
// Start server
|
||||
//
|
||||
// The port comes from APP_PORT, defaulting to the 1122 this has always
|
||||
// served on. It was hardcoded, which left `config.Load()`'s Port field
|
||||
// dead and the Dockerfile's `EXPOSE 1009` describing a port nothing
|
||||
// listened on — and made running a second copy locally, on a free port,
|
||||
// impossible without editing this line.
|
||||
port := os.Getenv("APP_PORT")
|
||||
if port == "" {
|
||||
port = "1122"
|
||||
}
|
||||
go func() {
|
||||
if err := app.Listen(":1122"); err != nil {
|
||||
log.Printf("🚀 listening on :%s", port)
|
||||
if err := app.Listen(":" + port); err != nil {
|
||||
log.Fatal("Server failed to start:", err)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user