GetPrimaryRouterHTTPPort returns app's primary router http port It has to choose from (highest to lowest priority): 1. Empty string if webserver type is generic and no web_extra_exposed_ports are defined 2. The actual port configured into running container via DDEV_ROUTER_HTTP_PORT 3. The project ro
()
| 710 | // 3. The project router_http_port |
| 711 | // 4. The global router_http_port |
| 712 | func (app *DdevApp) GetPrimaryRouterHTTPPort() string { |
| 713 | proposedPrimaryRouterHTTPPort := "80" |
| 714 | if globalconfig.DdevGlobalConfig.RouterHTTPPort != "" { |
| 715 | proposedPrimaryRouterHTTPPort = globalconfig.DdevGlobalConfig.RouterHTTPPort |
| 716 | } |
| 717 | if app.RouterHTTPPort != "" { |
| 718 | proposedPrimaryRouterHTTPPort = app.RouterHTTPPort |
| 719 | } |
| 720 | if httpPort := app.GetWebEnvVar("DDEV_ROUTER_HTTP_PORT"); httpPort != "" { |
| 721 | proposedPrimaryRouterHTTPPort = httpPort |
| 722 | } |
| 723 | if app.WebserverType == nodeps.WebserverGeneric && len(app.WebExtraExposedPorts) == 0 { |
| 724 | proposedPrimaryRouterHTTPPort = "" |
| 725 | } |
| 726 | return proposedPrimaryRouterHTTPPort |
| 727 | } |
| 728 | |
| 729 | // GetWebEnvVar gets an environment variable from the web service |
| 730 | // It returns empty string if there is no var or the ComposeYaml |