diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-13 02:32:18 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-13 02:32:18 -0500 |
commit | 8eb5120fbd19dac1221f82d84c339b4be9b0975b (patch) | |
tree | 3238704d9968d41f3f871adda4c280e3bd73685d /cmd/web.go | |
parent | 8c9338a5377c60c84cdee1f5781b3de5933bb3b0 (diff) | |
download | gitea-8eb5120fbd19dac1221f82d84c339b4be9b0975b.tar.gz gitea-8eb5120fbd19dac1221f82d84c339b4be9b0975b.zip |
#12, API: list user repos, list repo hooks
Diffstat (limited to 'cmd/web.go')
-rw-r--r-- | cmd/web.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/web.go b/cmd/web.go index 6b0ee9ef9e..74cfb75a03 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -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) |