all repos — legit @ 6857a2f002358c47f588c8417482a5afd01725d0

web frontend for git, written in go

routes/handler.go (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
package routes

import (
	"github.com/alexedwards/flow"
	"icyphox.sh/legit/config"
)

func Handlers(c *config.Config) *flow.Mux {
	mux := flow.New()
	d := deps{c}
	mux.HandleFunc("/:name", d.RepoIndex, "GET")
	mux.HandleFunc("/:name/tree/:ref/...", d.RepoFiles, "GET")
	return mux
}