Skip to content

Commit

Permalink
Merge pull request #33 from reportportal/ingress-to-path
Browse files Browse the repository at this point in the history
Ingress to path
  • Loading branch information
avarabyeu authored Nov 2, 2022
2 parents 1962091 + 53f5a4a commit 2faf8b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func main() {
TraefikV2Mode bool `env:"TRAEFIK_V2_MODE" envDefault:"false"`
TraefikLbURL string `env:"LB_URL" envDefault:"http://localhost:9091"`
LogLevel string `env:"LOG_LEVEL" envDefault:"info"`
Path string `env:"RESOURCE_PATH" envDefault:""`
}{
ServerConfig: cfg,
}
Expand Down Expand Up @@ -60,7 +61,7 @@ func main() {
srv.WithRouter(func(router *chi.Mux) {
router.Use(middleware.Logger)
router.NotFound(func(w http.ResponseWriter, rq *http.Request) {
http.Redirect(w, rq, "/ui/#notfound", http.StatusFound)
http.Redirect(w, rq, rpCfg.Path+"/ui/#notfound", http.StatusFound)
})

router.HandleFunc("/composite/info", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -74,10 +75,10 @@ func main() {
}
})
router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/ui/", http.StatusFound)
http.Redirect(w, r, rpCfg.Path+"/ui/", http.StatusFound)
})
router.HandleFunc("/ui", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/ui/", http.StatusFound)
http.Redirect(w, r, rpCfg.Path+"/ui/", http.StatusFound)
})
})
srv.StartServer()
Expand Down

0 comments on commit 2faf8b1

Please sign in to comment.