MCPcopy Create free account
hub / github.com/nhost/nhost / consoleCloud

Function consoleCloud

cli/dockercompose/compose_cloud.go:45–89  ·  view source on GitHub ↗
(
	cfg *model.ConfigConfig,
	subdomain string,
	cloudSubdomain string,
	cloudRegion string,
	cloudAdminSecret string,
	clouadPostgresURL string,
	httpPort uint,
	useTLS bool,
	nhostFolder string,
	ports ExposePorts,
)

Source from the content-addressed store, hash-verified

43}
44
45func consoleCloud(
46 cfg *model.ConfigConfig,
47 subdomain string,
48 cloudSubdomain string,
49 cloudRegion string,
50 cloudAdminSecret string,
51 clouadPostgresURL string,
52 httpPort uint,
53 useTLS bool,
54 nhostFolder string,
55 ports ExposePorts,
56) (*Service, error) {
57 console, err := console(cfg, subdomain, httpPort, useTLS, nhostFolder, ports.Console)
58 if err != nil {
59 return nil, err
60 }
61
62 scheme := schemeHTTP
63 if useTLS {
64 scheme = schemeHTTPS
65 }
66
67 cloudHasuraURL := clienv.NhostHasuraURL(cloudSubdomain, cloudRegion)
68
69 console.DependsOn = nil
70 console.Command = []string{
71 "bash", "-c",
72 fmt.Sprintf(`
73 hasura-cli \
74 console \
75 --no-browser \
76 --endpoint %s \
77 --address 0.0.0.0 \
78 --console-port 9695 \
79 --api-port %d \
80 --api-host %s://%s.hasura.local.nhost.run \
81 --console-hge-endpoint %s`,
82 cloudHasuraURL, httpPort, scheme, subdomain, cloudHasuraURL),
83 }
84
85 console.Environment["HASURA_GRAPHQL_ADMIN_SECRET"] = cloudAdminSecret
86 console.Environment["HASURA_GRAPHQL_DATABASE_URL"] = clouadPostgresURL
87
88 return console, nil
89}
90
91func getServicesCloud( //nolint:funlen
92 cfg *model.ConfigConfig,

Callers 1

getServicesCloudFunction · 0.85

Calls 2

NhostHasuraURLFunction · 0.92
consoleFunction · 0.85

Tested by

no test coverage detected