summaryrefslogtreecommitdiff
path: root/pkg/app
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/app')
-rw-r--r--pkg/app/app.go25
-rw-r--r--pkg/app/routes.go18
2 files changed, 0 insertions, 43 deletions
diff --git a/pkg/app/app.go b/pkg/app/app.go
deleted file mode 100644
index 89a2bd34..00000000
--- a/pkg/app/app.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package app
-
-import (
- "os"
-
- "github.com/xlgmokha/x/pkg/log"
- "gitlab.com/mokhax/spike/pkg/authz"
- "gitlab.com/mokhax/spike/pkg/cfg"
- "gitlab.com/mokhax/spike/pkg/srv"
-)
-
-func Start(bindAddr string) error {
- logger := log.New(os.Stdout, log.Fields{"app": "gtwy"})
- mux := authz.HTTP(authz.WithCasbin(), Routes())
- return srv.Run(cfg.New(
- bindAddr,
- cfg.WithMux(log.HTTP(logger)(mux)),
- cfg.WithTLS([]string{
- "api.example.com",
- "authzd.example.com",
- "idp.example.com",
- "ui.example.com",
- }),
- ))
-}
diff --git a/pkg/app/routes.go b/pkg/app/routes.go
deleted file mode 100644
index ff1291c2..00000000
--- a/pkg/app/routes.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package app
-
-import (
- "net/http"
-
- "gitlab.com/mokhax/spike/pkg/prxy"
-)
-
-func Routes() http.Handler {
- mux := http.NewServeMux()
- mux.Handle("/", prxy.New(map[string]string{
- "api.example.com": "http://localhost:8284",
- "authzd.example.com": "http://localhost:50051",
- "idp.example.com": "http://localhost:8282",
- "ui.example.com": "http://localhost:8283",
- }))
- return mux
-}