Fix pathing with relative non-single-depth root
This commit is contained in:
@@ -12,6 +12,10 @@ func (s *Server) Routes() error {
|
||||
path string
|
||||
handler http.HandlerFunc
|
||||
}{
|
||||
{
|
||||
path: "/",
|
||||
handler: s.root,
|
||||
},
|
||||
{
|
||||
path: fmt.Sprintf("notes/%s%s", wildcard, wildcard),
|
||||
handler: s.authenticate(s.notes),
|
||||
@@ -37,3 +41,8 @@ func (s *Server) Routes() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) root(w http.ResponseWriter, r *http.Request) {
|
||||
r.URL.Path = "/notes"
|
||||
http.Redirect(w, r, r.URL.String(), http.StatusPermanentRedirect)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user