Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

const (
DefaultApexEndpoint = "https://api.enterprise-sandbox.fystack.io"
// ProductionApexEndpoint is listed in the setup menu but not selectable yet.
// ProductionApexEndpoint is offered as an environment in the setup menu.
ProductionApexEndpoint = "https://api.fystack.io"
defaultTokenMax = 4096
operatorSchema = 2
Expand Down
17 changes: 12 additions & 5 deletions internal/app/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,25 @@ func (a *App) promptEndpoint(defaultValue string) (string, error) {
if !ok || !isTerminal(file) {
return defaultValue, nil
}
const custom = 2
const (
sandbox = iota
production
custom
)
options := []menuOption{
{Label: fmt.Sprintf("Sandbox %s", defaultValue)},
{Label: fmt.Sprintf("Production %s (coming soon)", ProductionApexEndpoint), Disabled: true},
{Label: "Custom endpoint"},
sandbox: {Label: fmt.Sprintf("Sandbox %s", defaultValue)},
production: {Label: fmt.Sprintf("Production %s", ProductionApexEndpoint)},
custom: {Label: "Custom endpoint"},
}
choice, err := a.choose(file, "Fystack environment", options)
if err != nil {
return "", fmt.Errorf("read Fystack environment: %w", err)
}
if choice != custom {
switch choice {
case sandbox:
return defaultValue, nil
case production:
return ProductionApexEndpoint, nil
}
for {
fmt.Fprint(a.Out, "Custom endpoint: ")
Expand Down
Loading