aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-12-15 00:24:41 -0500
committerUnknwon <u@gogs.io>2018-12-15 00:24:41 -0500
commitee82d35ed807b32aaf04a505e5b5260f20aaf641 (patch)
tree56eda61eccb6bf1317ba1fc260a575a99d935ece /pkg
parent8bca30cfe44bd443906dc7a6d1491a94220a1dc1 (diff)
api: add GetSingleCommit (#5546)
Diffstat (limited to 'pkg')
-rw-r--r--pkg/context/api.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/context/api.go b/pkg/context/api.go
index 439fb5df..7dc4472b 100644
--- a/pkg/context/api.go
+++ b/pkg/context/api.go
@@ -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)
}