/reload routing
This commit is contained in:
parent
5e3de474a4
commit
3a68058e14
1 changed files with 6 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
braillexr "github.com/spatialfree/dofdev/web/pages/braille_xr"
|
braillexr "github.com/spatialfree/dofdev/web/pages/braille_xr"
|
||||||
"github.com/spatialfree/dofdev/web/pages/mono"
|
"github.com/spatialfree/dofdev/web/pages/mono"
|
||||||
|
"github.com/spatialfree/dofdev/tem"
|
||||||
)
|
)
|
||||||
|
|
||||||
func New() *mux.Router {
|
func New() *mux.Router {
|
||||||
|
@ -15,5 +16,10 @@ func New() *mux.Router {
|
||||||
r.HandleFunc("/", mono.Handler)
|
r.HandleFunc("/", mono.Handler)
|
||||||
r.HandleFunc("/braille_xr", braillexr.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
|
return r
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue