diff options
| author | Bobby <[email protected]> | 2025-06-15 00:24:39 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-06-15 00:24:39 +0530 |
| commit | f1085e328bc3229e22c15c5685411649587c2832 (patch) | |
| tree | 21c7787fa06f834c8ef6246b1249efa727c936de | |
| parent | e974cf1efb210a130d14c4edf2f946ffbac71853 (diff) | |
| download | imageboard-f1085e328bc3229e22c15c5685411649587c2832.tar.xz imageboard-f1085e328bc3229e22c15c5685411649587c2832.zip | |
make server port int
| -rw-r--r-- | config/types.go | 2 | ||||
| -rw-r--r-- | imageboard/main.go | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/config/types.go b/config/types.go index 994b93e..34981c9 100644 --- a/config/types.go +++ b/config/types.go @@ -4,7 +4,7 @@ import "time" type ServerConfig struct {
Host string `env:"SERVER_HOST" default:"localhost"`
- Port string `env:"SERVER_PORT" default:"8080"`
+ Port int `env:"SERVER_PORT" default:"8080"`
AppName string `env:"APP_NAME" default:"ImageBoard"`
}
diff --git a/imageboard/main.go b/imageboard/main.go index bce8cd1..d5a3c88 100644 --- a/imageboard/main.go +++ b/imageboard/main.go @@ -1,6 +1,7 @@ package main
import (
+ "fmt"
"imageboard/config"
"imageboard/middleware"
"imageboard/processors"
@@ -43,5 +44,5 @@ func main() { router.Initialize(app)
- log.Fatalf("Server failed to start: %v", app.Listen(config.Server.Host+":"+config.Server.Port))
+ log.Fatalf("Server failed to start: %v", app.Listen(fmt.Sprintf("%s:%d", config.Server.Host, config.Server.Port)))
}
|
