diff options
author | Unknwon <u@gogs.io> | 2015-10-22 17:46:07 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-10-22 17:46:07 -0400 |
commit | 35a65736fa1361d1d0fb83217f95d7aa8ca71336 (patch) | |
tree | 0b51195927a0fd2478d7d69c25e9eca8bc8ea30a /cmd | |
parent | 04af4b24fd87bb2ee8a2a3cecd66c5c1b1e413dd (diff) | |
download | gitea-35a65736fa1361d1d0fb83217f95d7aa8ca71336.tar.gz gitea-35a65736fa1361d1d0fb83217f95d7aa8ca71336.zip |
add get repo API
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/web.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cmd/web.go b/cmd/web.go index 6ca61aea96..45a5ff2fa9 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -224,11 +224,12 @@ func runWeb(ctx *cli.Context) { m.Group("/repos", func() { m.Get("/search", v1.SearchRepos) + }) - m.Group("", func() { - m.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), v1.MigrateRepo) - m.Delete("/:username/:reponame", v1.DeleteRepo) - }, middleware.ApiReqToken()) + m.Group("/repos", func() { + m.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), v1.MigrateRepo) + m.Combo("/:username/:reponame").Get(v1.GetRepo) + m.Delete("/:username/:reponame", v1.DeleteRepo) m.Group("/:username/:reponame", func() { m.Combo("/hooks").Get(v1.ListRepoHooks). @@ -236,8 +237,8 @@ func runWeb(ctx *cli.Context) { m.Patch("/hooks/:id:int", bind(api.EditHookOption{}), v1.EditRepoHook) m.Get("/raw/*", middleware.RepoRef(), v1.GetRepoRawFile) m.Get("/archive/*", v1.GetRepoArchive) - }, middleware.ApiRepoAssignment(), middleware.ApiReqToken()) - }) + }, middleware.ApiRepoAssignment()) + }, middleware.ApiReqToken()) m.Any("/*", func(ctx *middleware.Context) { ctx.Error(404) |