diff --git a/backend/controller/controller.go b/backend/controller/controller.go index 9f07e9b1c9..82a0a4ae3e 100644 --- a/backend/controller/controller.go +++ b/backend/controller/controller.go @@ -86,7 +86,7 @@ func Start(ctx context.Context, config Config, runnerScaling scaling.RunnerScali _, _ = w.Write([]byte("Console not installed.")) }) } else { - consoleHandler, err = frontend.Server(ctx, config.ContentTime, config.ConsoleURL) + consoleHandler, err = frontend.Server(ctx, config.ContentTime, config.Bind, config.ConsoleURL) if err != nil { return err } diff --git a/frontend/local.go b/frontend/local.go index f96c6b0919..fb63b7d3c3 100644 --- a/frontend/local.go +++ b/frontend/local.go @@ -14,10 +14,10 @@ import ( "github.com/TBD54566975/ftl/internal/log" ) -var consoleURL, _ = url.Parse("http://localhost:5173") -var proxy = httputil.NewSingleHostReverseProxy(consoleURL) +var proxyURL, _ = url.Parse("http://localhost:5173") +var proxy = httputil.NewSingleHostReverseProxy(proxyURL) -func Server(ctx context.Context, timestamp time.Time, allowOrigin *url.URL) (http.Handler, error) { +func Server(ctx context.Context, timestamp time.Time, publicURL *url.URL, allowOrigin *url.URL) (http.Handler, error) { logger := log.FromContext(ctx) logger.Debugf("Building console...") @@ -30,7 +30,7 @@ func Server(ctx context.Context, timestamp time.Time, allowOrigin *url.URL) (htt if err != nil { return nil, err } - logger.Infof("Web console available at: %s", consoleURL) + logger.Infof("Web console available at: %s", publicURL.String()) if allowOrigin == nil { return proxy, nil diff --git a/frontend/release.go b/frontend/release.go index 5b9d1575f8..d9115df8f8 100644 --- a/frontend/release.go +++ b/frontend/release.go @@ -22,7 +22,7 @@ import ( //go:embed all:dist var build embed.FS -func Server(ctx context.Context, timestamp time.Time, allowOrigin *url.URL) (http.Handler, error) { +func Server(ctx context.Context, timestamp time.Time, publicURL *url.URL, allowOrigin *url.URL) (http.Handler, error) { dir, err := fs.Sub(build, "dist") if err != nil { return nil, err