legit/routes/handler.go

16 lines
344 B
Go
Raw Normal View History

2022-12-11 05:52:47 +00:00
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")
2022-12-11 08:48:39 +00:00
mux.HandleFunc("/:name/tree/:ref/...", d.RepoTree, "GET")
mux.HandleFunc("/:name/blob/:ref/...", d.FileContent, "GET")
2022-12-11 05:52:47 +00:00
return mux
}