all repos — legit @ c165c447685d68c2b0b2293a31937a903394f943

web frontend for git

routes/handler.go (view raw)

 1package routes
 2
 3import (
 4	"github.com/alexedwards/flow"
 5	"icyphox.sh/legit/config"
 6)
 7
 8func Handlers(c *config.Config) *flow.Mux {
 9	mux := flow.New()
10	d := deps{c}
11	mux.HandleFunc("/:name", d.RepoIndex, "GET")
12	mux.HandleFunc("/:name/tree/:ref/...", d.RepoTree, "GET")
13	mux.HandleFunc("/:name/blob/:ref/...", d.FileContent, "GET")
14	mux.HandleFunc("/:name/log/:ref", d.Log, "GET")
15	mux.HandleFunc("/:name/commit/:ref", d.Diff, "GET")
16	return mux
17}