From 8e5dfb96dca08ff8bd5b2f7ad47dd22ac2f799c5 Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 4 Mar 2025 14:35:24 -0700 Subject: feat: add API gateway to reverse proxy requests in front of two different services --- magefile.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'magefile.go') 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) } -- cgit v1.2.3