From ee82d35ed807b32aaf04a505e5b5260f20aaf641 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 15 Dec 2018 00:24:41 -0500 Subject: api: add GetSingleCommit (#5546) --- pkg/context/api.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pkg/context') 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) } -- cgit v1.2.3