Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Commit 735952a

Browse files
authored
fix: use FTL_DEV_ENDPOINT instead of FTL_ENDPOINT when using ftl dev (#4747)
When working with multiple environments, I set `FTL_ENDPOINT` to point to them. If I forget to unset it, it breaks `ftl dev` for me. This makes `ftl dev` ignore `FTL_ENDPOINT` when running the dev environment.
1 parent 100d768 commit 735952a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cmd/ftl/cmd_dev.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/block/ftl/internal/dev"
2323
"github.com/block/ftl/internal/log"
2424
"github.com/block/ftl/internal/projectconfig"
25+
"github.com/block/ftl/internal/rpc"
2526
"github.com/block/ftl/internal/schema/schemaeventsource"
2627
"github.com/block/ftl/internal/terminal"
2728
"github.com/block/ftl/internal/timelineclient"
@@ -30,10 +31,11 @@ import (
3031
const maxLogs = 10
3132

3233
type devCmd struct {
33-
Watch time.Duration `help:"Watch template directory at this frequency and regenerate on change." default:"500ms"`
34-
NoServe bool `help:"Do not start the FTL server." default:"false"`
35-
ServeCmd serveCommonConfig `embed:""`
36-
Build buildCmd `embed:""`
34+
Watch time.Duration `help:"Watch template directory at this frequency and regenerate on change." default:"500ms"`
35+
NoServe bool `help:"Do not start the FTL server." default:"false"`
36+
ServeCmd serveCommonConfig `embed:""`
37+
Build buildCmd `embed:""`
38+
DevEndpoint *url.URL `help:"Admin endpoint." env:"FTL_DEV_ENDPOINT" default:"http://127.0.0.1:8892"`
3739
}
3840

3941
func (d *devCmd) Run(
@@ -44,10 +46,12 @@ func (d *devCmd) Run(
4446
bindContext terminal.KongContextBinder,
4547
schemaEventSource *schemaeventsource.EventSource,
4648
timelineClient *timelineclient.Client,
47-
adminClient ftlv1connect.AdminServiceClient,
4849
buildEngineClient buildenginepbconnect.BuildEngineServiceClient,
4950
csm *currentStatusManager,
5051
) error {
52+
adminClient := rpc.Dial(ftlv1connect.NewAdminServiceClient, d.DevEndpoint.String(), log.Error)
53+
ctx = rpc.ContextWithClient(ctx, adminClient)
54+
5155
startTime := time.Now()
5256
ctx, cancel := context.WithCancelCause(ctx)
5357
defer cancel(fmt.Errorf("stopping dev server: %w", context.Canceled))

0 commit comments

Comments
 (0)