diff --git a/src/router/router.go b/src/router/router.go index 98a1f04..dfb5c03 100644 --- a/src/router/router.go +++ b/src/router/router.go @@ -3,10 +3,15 @@ package router import ( "net/http" + "dofdev/web/pages/about" + braillexr "dofdev/web/pages/braille_xr" + "dofdev/web/pages/games" + "dofdev/web/pages/mono" + "dofdev/web/pages/moves" + "dofdev/web/pages/projects" + "dofdev/web/pages/sc" + "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 { @@ -14,12 +19,22 @@ func New() *mux.Router { r.PathPrefix(("/public/")).Handler(http.StripPrefix("/public/", http.FileServer(http.Dir("web/public/")))) r.HandleFunc("/", mono.Handler) + r.HandleFunc("/about", about.Handler) + r.HandleFunc("/moves", moves.Handler) + r.HandleFunc("/move/{hash}", moves.MoveHandler) + r.HandleFunc("/games", games.Handler) + r.HandleFunc("/game/{hash}", games.GameHandler) + r.HandleFunc("/projects", projects.Handler) + r.HandleFunc("/project/{hash}", projects.ProjectHandler) + + r.HandleFunc("/sc", sc.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) - }) + // 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 }