cerrado @ fb45f1f5002ffdb40150333c5a48458b801f3022

ref: Move to gorilla mux

Go's default mux is very limited while comes to overlapping routes.
For example "/{name}/about" conflicts with "/static/" and it throws a
panic.

In the case I would like static to have precedence over everything else.
 1diff --git a/go.mod b/go.mod
 2index 5bd4d7647b43cb737a873b5636a162a1ea25df69..eabf863a1cad6dd1f4d7987411f42b61998c30f6 100644
 3--- a/go.mod
 4+++ b/go.mod
 5@@ -8,6 +8,7 @@ 	github.com/alecthomas/chroma/v2 v2.13.0
 6 	github.com/go-git/go-git/v5 v5.12.0
 7 	github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2
 8 	github.com/google/go-cmp v0.6.0
 9+	github.com/gorilla/mux v1.8.1
10 	github.com/valyala/quicktemplate v1.7.0
11 	golang.org/x/sync v0.7.0
12 )
13diff --git a/go.sum b/go.sum
14index 69c34b73d113fa1f0ae49c5068a2517c3ee91725..bc82b643fa7d12dfe3959e2d53a409f8defb51cb 100644
15--- a/go.sum
16+++ b/go.sum
17@@ -51,6 +51,8 @@ github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 h1:yEt5djSYb4iNtmV9iJGVday+i4e9u6Mrn5iP64HH5QM=
18 github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
19 github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
20 github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
21+github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
22+github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
23 github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
24 github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
25 github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
26diff --git a/pkg/handler/router.go b/pkg/handler/router.go
27index 1150f2fd2ef5ee67eacd19f5a20d1c6d2b5150e4..f73e9fba6d0e2ce0127d6798fc26ebf017969c0d 100644
28--- a/pkg/handler/router.go
29+++ b/pkg/handler/router.go
30@@ -9,6 +9,7 @@ 	"git.gabrielgio.me/cerrado/pkg/handler/config"
31 	"git.gabrielgio.me/cerrado/pkg/handler/git"
32 	"git.gabrielgio.me/cerrado/pkg/handler/static"
33 	"git.gabrielgio.me/cerrado/pkg/service"
34+	"github.com/gorilla/mux"
35 )
36 
37 // Mount handler gets the requires service and repository to build the handlers
38@@ -29,11 +30,16 @@ 	if err != nil {
39 		return nil, err
40 	}
41 
42-	mux := http.NewServeMux()
43-	mux.Handle("/static/", staticHandler)
44+	mux := mux.NewRouter()
45+
46+	mux.PathPrefix("/static").Handler(staticHandler)
47+	mux.HandleFunc("/{name}/about", gitHandler.About)
48+	mux.HandleFunc("/{name}/summary", gitHandler.Summary)
49+	mux.HandleFunc("/{name}/refs", gitHandler.Refs)
50+	mux.HandleFunc("/{name}/tree", gitHandler.Tree)
51+	mux.HandleFunc("/{name}/log", gitHandler.Log)
52 	mux.HandleFunc("/config", configHander)
53 	mux.HandleFunc("/about", aboutHandler.About)
54-	mux.HandleFunc("/{name}", gitHandler.Item)
55 	mux.HandleFunc("/", gitHandler.List)
56 	return mux, nil
57 }