'Beego: accessing the absolute url of a request

I am new to Beego.

Is there a way to obtain the base url in Beego (e.g. "https://example.com")? I want insert a variable (BaseURL) into the templates context for constructing absolute URLs.

I have tried web.Controller.Ctx.Request.URL.String() but this gives the relative URI?

Many thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source