#12, API: list user repos, list repo hooks

This commit is contained in:
Unknwon 2014-11-13 02:32:18 -05:00
parent 8c9338a537
commit 8eb5120fbd
12 changed files with 315 additions and 37 deletions

View file

@ -157,7 +157,7 @@ func runWeb(*cli.Context) {
m.Get("/issues", user.Issues)
}, reqSignIn)
// API routers.
// API.
m.Group("/api", func() {
m.Group("/v1", func() {
// Miscellaneous.
@ -170,9 +170,14 @@ func runWeb(*cli.Context) {
})
// Repositories.
m.Get("/user/repos", v1.ListMyRepos)
m.Group("/repos", func() {
m.Get("/search", v1.SearchRepos)
m.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), v1.Migrate)
m.Group("/:username/:reponame", func() {
m.Combo("/hooks").Get(v1.ListRepoHooks)
}, middleware.ApiRepoAssignment())
})
m.Any("/*", func(ctx *middleware.Context) {
@ -181,7 +186,7 @@ func runWeb(*cli.Context) {
})
})
// User routers.
// User.
m.Group("/user", func() {
m.Get("/login", user.SignIn)
m.Post("/login", bindIgnErr(auth.SignInForm{}), user.SignInPost)