diff options
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r-- | routers/api/v1/api.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index f5a1fd6d86..8418ab94a1 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -659,7 +659,16 @@ func RegisterRoutes(m *macaron.Macaron) { }) m.Get("/refs", repo.GetGitAllRefs) m.Get("/refs/*", repo.GetGitRefs) - m.Combo("/trees/:sha", context.RepoRef()).Get(repo.GetTree) + m.Get("/trees/:sha", context.RepoRef(), repo.GetTree) + m.Get("/blobs/:sha", context.RepoRef(), repo.GetBlob) + }, reqRepoReader(models.UnitTypeCode)) + m.Group("/contents", func() { + m.Get("/*", repo.GetFileContents) + m.Group("/*", func() { + m.Post("", bind(api.CreateFileOptions{}), repo.CreateFile) + m.Put("", bind(api.UpdateFileOptions{}), repo.UpdateFile) + m.Delete("", bind(api.DeleteFileOptions{}), repo.DeleteFile) + }, reqRepoWriter(models.UnitTypeCode), reqToken()) }, reqRepoReader(models.UnitTypeCode)) }, repoAssignment()) }) |