Offline first

This commit is contained in:
Magnus Åhall 2026-05-20 19:58:34 +02:00
parent 84181858c8
commit f37ebc1c41
4 changed files with 81 additions and 16 deletions

10
main.go
View file

@ -132,6 +132,7 @@ func main() { // {{{
http.HandleFunc("/notes2", pageNotes2)
http.HandleFunc("/login", pageLogin)
http.HandleFunc("/sync", pageSync)
http.HandleFunc("/offline", pageOffline)
http.HandleFunc("/user/authenticate", AuthManager.AuthenticationHandler)
@ -226,6 +227,15 @@ func pageServiceWorker(w http.ResponseWriter, r *http.Request) { // {{{
return
}
} // }}}
func pageOffline(w http.ResponseWriter, r *http.Request) { // {{{
page := NewPage("offline")
err := Webengine.Render(page, w, r)
if err != nil {
w.Write([]byte(err.Error()))
return
}
} // }}}
func pageLogin(w http.ResponseWriter, r *http.Request) { // {{{
page := NewPage("login")