diff options
Diffstat (limited to 'pkg/handler/router.go')
-rw-r--r-- | pkg/handler/router.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pkg/handler/router.go b/pkg/handler/router.go index 79f70f1..bdf883e 100644 --- a/pkg/handler/router.go +++ b/pkg/handler/router.go @@ -9,7 +9,6 @@ import ( "git.gabrielgio.me/cerrado/pkg/handler/git" "git.gabrielgio.me/cerrado/pkg/handler/static" "git.gabrielgio.me/cerrado/pkg/service" - "github.com/gorilla/mux" ) // Mount handler gets the requires service and repository to build the handlers @@ -25,17 +24,17 @@ func MountHandler( configHander = config.ConfigFile(configRepo) ) - staticHandler, err := static.NewStaticHander("/static/") + staticHandler, err := static.ServeStaticHandler() if err != nil { return nil, err } - mux := mux.NewRouter() + mux := http.NewServeMux() - mux.PathPrefix("/static").Handler(staticHandler) - mux.HandleFunc("/{name}/about", gitHandler.About) + mux.HandleFunc("/static/{file}", staticHandler) + mux.HandleFunc("/{name}/about/{$}", gitHandler.About) mux.HandleFunc("/{name}", gitHandler.Summary) - mux.HandleFunc("/{name}/refs", gitHandler.Refs) + mux.HandleFunc("/{name}/refs/{$}", gitHandler.Refs) mux.HandleFunc("/{name}/tree/{ref}", gitHandler.Tree) mux.HandleFunc("/{name}/log/{ref}", gitHandler.Log) mux.HandleFunc("/config", configHander) |