mirror of
https://github.com/documize/community.git
synced 2025-07-21 22:29:41 +02:00
refactored getAppURL
This commit is contained in:
parent
6cc6b6d70f
commit
2e39b7a471
5 changed files with 22 additions and 26 deletions
|
@ -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{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue