Skip to content

Commit

Permalink
fix: update url output for the console
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman committed Mar 6, 2024
1 parent ac87ced commit ea1d6e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions frontend/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...")

Expand All @@ -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
Expand Down

0 comments on commit ea1d6e1

Please sign in to comment.