MCPcopy Index your code
hub / github.com/ddev/ddev / GetPrimaryURL

Method GetPrimaryURL

pkg/ddevapp/ddevapp.go:3519–3531  ·  view source on GitHub ↗

GetPrimaryURL returns the primary URL that can be used, https or http

()

Source from the content-addressed store, hash-verified

3517
3518// GetPrimaryURL returns the primary URL that can be used, https or http
3519func (app *DdevApp) GetPrimaryURL() string {
3520 httpURLs, httpsURLs, _ := app.GetAllURLs()
3521 urlList := httpsURLs
3522 // If no mkcert trusted https, use the httpURLs instead
3523 if app.CanUseHTTPOnly() {
3524 urlList = httpURLs
3525 }
3526 if len(urlList) > 0 {
3527 return urlList[0]
3528 }
3529 // Failure mode, returns an empty string
3530 return ""
3531}
3532
3533// GetWebContainerDirectHTTPURL returns the URL that can be used without the router to get to web container.
3534func (app *DdevApp) GetWebContainerDirectHTTPURL() string {

Callers 15

TestDdevFullSiteSetupFunction · 0.95
TestHardenedStartFunction · 0.95
DescribeMethod · 0.95
DockerEnvMethod · 0.95
TestEnvironmentVariablesFunction · 0.80
shopware6PostStartActionFunction · 0.80
TestCustomGlobalConfigFunction · 0.80
asteriosPostStartActionFunction · 0.80

Calls 2

GetAllURLsMethod · 0.95
CanUseHTTPOnlyMethod · 0.95

Tested by 15

TestDdevFullSiteSetupFunction · 0.76
TestHardenedStartFunction · 0.76
TestEnvironmentVariablesFunction · 0.64
shopware6PostStartActionFunction · 0.64
TestCustomGlobalConfigFunction · 0.64
TestExtraPortExposeFunction · 0.64
TestCmdXHGuiFunction · 0.64