Change /notes2 to /

This commit is contained in:
Magnus Åhall 2026-05-29 09:03:59 +02:00
parent 662053e750
commit f3e16207a6
5 changed files with 10 additions and 16 deletions

19
main.go
View file

@ -129,7 +129,6 @@ func main() { // {{{
}
http.HandleFunc("/", rootHandler)
http.HandleFunc("/notes2", pageNotes2)
http.HandleFunc("/login", pageLogin)
http.HandleFunc("/sync", pageSync)
http.HandleFunc("/offline", pageOffline)
@ -189,8 +188,13 @@ func rootHandler(w http.ResponseWriter, r *http.Request) { // {{{
// All URLs not specifically handled are routed to this function.
// Everything going here should be a static resource.
if r.URL.Path == "/" {
http.Redirect(w, r, "/notes2", http.StatusSeeOther)
return
page := NewPage("notes2")
err := Webengine.Render(page, w, r)
if err != nil {
w.Write([]byte(err.Error()))
return
}
}
Webengine.StaticResource(w, r)
@ -245,15 +249,6 @@ func pageLogin(w http.ResponseWriter, r *http.Request) { // {{{
return
}
} // }}}
func pageNotes2(w http.ResponseWriter, r *http.Request) { // {{{
page := NewPage("notes2")
err := Webengine.Render(page, w, r)
if err != nil {
w.Write([]byte(err.Error()))
return
}
} // }}}
func pageSync(w http.ResponseWriter, r *http.Request) { // {{{
page := NewPage("sync")