Skip to content

Commit

Permalink
Update server port
Browse files Browse the repository at this point in the history
  • Loading branch information
cant-code committed May 2, 2024
1 parent 48fdbbf commit 71645a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func main() {
go consumer.Consume(dependencies)

h := handlers.Dependencies{DBConn: dependencies.DBConn, Auth: dependencies.Configs.Auth}
if err := http.ListenAndServe(":8080", h.ApiHandler()); err != nil {
if err := http.ListenAndServe(":"+dependencies.Configs.Server.Port, h.ApiHandler()); err != nil {
log.Println(err)
}
}
4 changes: 3 additions & 1 deletion config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ db:
username: postgres
password: pass
auth:
url: http://localhost:8900/realms/yt-clone
url: http://localhost:8900/realms/yt-clone
server:
port: 8090
13 changes: 8 additions & 5 deletions internal/configurations/config-setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ type Auth struct {
}

type Config struct {
MQ MQConfig
Jobs SubscriberConfig
Aws AwsConfig
DB DBConfig
Auth Auth
MQ MQConfig
Jobs SubscriberConfig
Aws AwsConfig
DB DBConfig
Auth Auth
Server struct {
Port string
}
}

func LoadConfig() (Config, error) {
Expand Down

0 comments on commit 71645a7

Please sign in to comment.