Skip to content

Commit

Permalink
Update according to path handling without rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Mar 25, 2024
1 parent a6c997a commit 75c73c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ func main() {
http.Redirect(w, rq, rpCfg.Path+"/ui/#notfound", http.StatusFound)
})

router.HandleFunc("/composite/info", func(w http.ResponseWriter, r *http.Request) {
router.HandleFunc(rpCfg.Path+"/composite/info", func(w http.ResponseWriter, r *http.Request) {
if err := server.WriteJSON(http.StatusOK, aggreg.AggregateInfo(), w); nil != err {
log.Error(err)
}
})
router.HandleFunc("/composite/health", func(w http.ResponseWriter, r *http.Request) {
router.HandleFunc(rpCfg.Path+"/composite/health", func(w http.ResponseWriter, r *http.Request) {
if err := server.WriteJSON(http.StatusOK, aggreg.AggregateHealth(), w); nil != err {
log.Error(err)
}
})
router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
router.HandleFunc(rpCfg.Path+"/", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, rpCfg.Path+"/ui/", http.StatusFound)
})
router.HandleFunc("/ui", func(w http.ResponseWriter, r *http.Request) {
router.HandleFunc(rpCfg.Path+"/ui", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, rpCfg.Path+"/ui/", http.StatusFound)
})
})
Expand Down

0 comments on commit 75c73c2

Please sign in to comment.