1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-21 22:29:41 +02:00

refactored getAppURL

This commit is contained in:
Harvey Kandola 2016-07-25 12:25:23 -07:00
parent 6cc6b6d70f
commit 2e39b7a471
5 changed files with 22 additions and 26 deletions

View file

@ -42,6 +42,17 @@ type Context struct {
Transaction *sqlx.Tx
}
//GetAppURL returns full HTTP url for the app
func (c *Context) GetAppURL(endpoint string) string {
scheme := "http://"
if c.SSL {
scheme = "https://"
}
return fmt.Sprintf("%s%s/%s", scheme, c.AppURL, endpoint)
}
// NewContext simply returns a blank Context type.
func NewContext() Context {
return Context{}