MCPcopy Index your code
hub / github.com/coder/coder / SubdomainAppURL

Method SubdomainAppURL

coderd/workspaceapps/apptest/setup.go:161–180  ·  view source on GitHub ↗

SubdomainAppURL returns the URL for the given subdomain app.

(app App)

Source from the content-addressed store, hash-verified

159
160// SubdomainAppURL returns the URL for the given subdomain app.
161func (d *Details) SubdomainAppURL(app App) *url.URL {
162 // Agent name is optional when app slug is present
163 agentName := app.AgentName
164 if !appurl.PortRegex.MatchString(app.AppSlugOrPort) {
165 agentName = ""
166 }
167
168 appHost := appurl.ApplicationURL{
169 Prefix: app.Prefix,
170 AppSlugOrPort: app.AppSlugOrPort,
171 AgentName: agentName,
172 WorkspaceName: app.WorkspaceName,
173 Username: app.Username,
174 }
175 u := *d.PathAppBaseURL
176 u.Host = strings.Replace(d.Options.AppHost, "*", appHost.String(), 1)
177 u.Path = "/"
178 u.RawQuery = app.Query
179 return &u
180}
181
182// setupProxyTestWithFactory does the following:
183// 1. Create a deployment with the factory.

Callers 1

RunFunction · 0.80

Calls 2

StringMethod · 0.95
ReplaceMethod · 0.80

Tested by

no test coverage detected