summaryrefslogtreecommitdiff
path: root/testrig/router.go
diff options
context:
space:
mode:
Diffstat (limited to 'testrig/router.go')
-rw-r--r--testrig/router.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/testrig/router.go b/testrig/router.go
index 5ab228611..b8f6a77f5 100644
--- a/testrig/router.go
+++ b/testrig/router.go
@@ -22,6 +22,7 @@ import (
"context"
"os"
"path/filepath"
+ "strconv"
"github.com/gin-gonic/gin"
"github.com/superseriousbusiness/gotosocial/internal/config"
@@ -44,6 +45,12 @@ func NewTestRouter(db db.DB) router.Router {
config.SetBindAddress(alternativeBindAddress)
}
+ if alternativePortStr := os.Getenv("GTS_PORT"); alternativePortStr != "" {
+ if alternativePort, err := strconv.Atoi(alternativePortStr); err == nil {
+ config.SetPort(alternativePort)
+ }
+ }
+
r, err := router.New(context.Background(), db)
if err != nil {
panic(err)