diff options
| author | mo khan <mo@mokhan.ca> | 2025-03-04 14:35:24 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-03-04 14:35:24 -0700 |
| commit | 8e5dfb96dca08ff8bd5b2f7ad47dd22ac2f799c5 (patch) | |
| tree | fe5fe4d72006850977b37f1d105d2fbc4cc75dd9 /magefile.go | |
| parent | 8abcc2c29e75ed7417422929446266ed5abd9c3b (diff) | |
feat: add API gateway to reverse proxy requests in front of two different services
Diffstat (limited to 'magefile.go')
| -rw-r--r-- | magefile.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/magefile.go b/magefile.go index 9c4a01bc..39afbf93 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) } |
