Skip to content

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

enable binding the api server to specific interface and port using environment variables.

Eriksson Monteiro7ddd7cd58141
diff --git a/api/.env.production b/api/.env.production
index 4e298e70..9ed9bbbb 100644
--- a/api/.env.production
+++ b/api/.env.production
@@ -20,6 +20,7 @@ SMTP_PORT=
APP_URL=
APP_NAME=
-APP_LOGO_URL=
+APP_PORT=8008
+APP_HOST=0.0.0.0
-DATABASE_URL
+DATABASE_URL=
diff --git a/api/main.go b/api/main.go
index 89e1b556..67a70e3a 100644
--- a/api/main.go
+++ b/api/main.go
@@ -2,7 +2,7 @@ package main
import (
"os"
-
+ "fmt"
_ "github.com/NdoleStudio/httpsms/docs"
"github.com/NdoleStudio/httpsms/pkg/di"
)
@@ -33,5 +33,5 @@ func main() {
}
container := di.NewContainer("http-sms", Version)
- container.Logger().Info(container.App().Listen(":8000").Error())
+ container.Logger().Info(container.App().Listen(fmt.Sprintf("%s:%s", os.Getenv("APP_HOST"), os.Getenv("APP_PORT"))).Error())
}