diff --git a/README.md b/README.md index 29fcdf2..42f9530 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,9 @@ vim .env # edit your config + `LND_ADDRESS`: LND address (with port) + `LND_MACAROON_HEX`: LND macaroon + `LND_CERT_HEX`: LND certificate -+ `LOG_FILE_PATH`: (optional) By default all logs are written to STDOUT. If you want to log to a file provide the log file path here ++ `LOG_FILE_PATH`: (optional) By default all logs are written to STDOUT. If you want to log to a file provide the log file path here + `SENTRY_DSN`: (optional) Sentry DSN for exception tracking ++ `PORT`: (default: 3000) Port the app should listen on ## Developing @@ -50,7 +51,7 @@ make ``` -## Database +## Database LndHub.go supports PostgreSQL and SQLite as database backend. But SQLite does not support the same data consistency checks as PostgreSQL. ### Ideas diff --git a/lib/service/config.go b/lib/service/config.go index d0fe717..668f78f 100644 --- a/lib/service/config.go +++ b/lib/service/config.go @@ -9,4 +9,5 @@ type Config struct { LNDAddress string `envconfig:"LND_ADDRESS" required:"true"` LNDMacaroonHex string `envconfig:"LND_MACAROON_HEX" required:"true"` LNDCertHex string `envconfig:"LND_CERT_HEX"` + Port int `envconfig:"PORT" default:"3000"` } diff --git a/main.go b/main.go index f6754c5..ff794cf 100644 --- a/main.go +++ b/main.go @@ -147,7 +147,7 @@ func main() { // Start server go func() { - if err := e.Start(":3000"); err != nil && err != http.ErrServerClosed { + if err := e.Start(fmt.Sprintf(":%v", c.Port)); err != nil && err != http.ErrServerClosed { e.Logger.Fatal("shutting down the server") } }()