api: add GetSingleCommit (#5546)

This commit is contained in:
Unknwon
2018-12-15 00:24:41 -05:00
parent 8bca30cfe4
commit ee82d35ed8
3 changed files with 102 additions and 1 deletions

View File

@@ -17,7 +17,11 @@ import (
)
type APIContext struct {
*Context
*Context // TODO: Reduce to only needed fields instead of full shadow
// Base URL for the version of API endpoints, e.g. https://try.gogs.io/api/v1
BaseURL string
Org *APIOrganization
}
@@ -96,6 +100,7 @@ func APIContexter() macaron.Handler {
return func(ctx *Context) {
c := &APIContext{
Context: ctx,
BaseURL: setting.AppURL + "api/v1",
}
ctx.Map(c)
}