Merge pull request #70 from getAlby/feature/configurable-port

Make port configurable
This commit is contained in:
Michael Bumann
2022-01-23 19:43:04 +02:00
committed by GitHub
3 changed files with 5 additions and 3 deletions

View File

@@ -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

View File

@@ -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"`
}

View File

@@ -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")
}
}()