/reload routing

This commit is contained in:
ethan merchant 2024-03-05 11:08:48 -05:00
parent 5e3de474a4
commit 3a68058e14

View file

@ -6,6 +6,7 @@ import (
"github.com/gorilla/mux"
braillexr "github.com/spatialfree/dofdev/web/pages/braille_xr"
"github.com/spatialfree/dofdev/web/pages/mono"
"github.com/spatialfree/dofdev/tem"
)
func New() *mux.Router {
@ -15,5 +16,10 @@ func New() *mux.Router {
r.HandleFunc("/", mono.Handler)
r.HandleFunc("/braille_xr", braillexr.Handler)
r.HandleFunc("/reload", func(w http.ResponseWriter, r *http.Request) {
tem.Load()
// route them back to where they came from
http.Redirect(w, r, r.Header.Get("Referer"), http.StatusFound)
})
return r
}