summaryrefslogtreecommitdiff
path: root/magefile.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-03-04 14:35:24 -0700
committermo khan <mo@mokhan.ca>2025-03-04 14:35:24 -0700
commit8e5dfb96dca08ff8bd5b2f7ad47dd22ac2f799c5 (patch)
treefe5fe4d72006850977b37f1d105d2fbc4cc75dd9 /magefile.go
parent8abcc2c29e75ed7417422929446266ed5abd9c3b (diff)
feat: add API gateway to reverse proxy requests in front of two different services
Diffstat (limited to 'magefile.go')
-rw-r--r--magefile.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/magefile.go b/magefile.go
index 9c4a01b..39afbf9 100644
--- a/magefile.go
+++ b/magefile.go
@@ -5,6 +5,7 @@ package main
import (
"context"
+ "runtime"
"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
@@ -24,12 +25,21 @@ func RunSp() error {
return sh.RunV("ruby", "./bin/sp")
}
+// Run the API Gateway
+func RunGateway() error {
+ return sh.RunV("go", "run", "./cmd/gtwy/main.go")
+}
+
// Open a web browser to the login page
func Browser() error {
- return sh.RunV("xdg-open", "http://localhost:8283/sessions/new")
+ if runtime.GOOS == "linux" {
+ return sh.RunV("xdg-open", "http://localhost:8080/sp/sessions/new")
+ } else {
+ return sh.RunV("open", "http://localhost:8080/sp/sessions/new")
+ }
}
// Run All the servers
func Run(ctx context.Context) {
- mg.CtxDeps(ctx, RunIdp, RunSp, Browser)
+ mg.CtxDeps(ctx, RunIdp, RunSp, RunGateway, Browser)
}