aboutsummaryrefslogtreecommitdiff
path: root/pkg/context/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/context/api.go')
-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)
}