Skip to content

Commit

Permalink
Set redirect url path and ns to required
Browse files Browse the repository at this point in the history
  • Loading branch information
guangbochen authored and gitlawr committed Sep 1, 2020
1 parent 73b105a commit c4284bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func main() {
EnvVar: "NAMESPACE",
Destination: &config.Namespace,
Usage: "The default namespace to store management resources",
Required: true,
},
cli.StringFlag{
Name: "image-storage-endpoint",
Expand Down
3 changes: 3 additions & 0 deletions pkg/server/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func Routes(h router.Handlers) http.Handler {
m.Use(urlbuilder.RedirectRewrite)

m.Path("/v1/{type}").Queries("action", "{action}").Handler(h.K8sResource)
m.Path("/").HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
http.Redirect(rw, req, "/dashboard/", http.StatusFound)
})
m.NotFoundHandler = router.Routes(h)

return m
Expand Down

0 comments on commit c4284bf

Please sign in to comment.