diff --git a/app/src/RelayEnvironment.ts b/app/src/RelayEnvironment.ts index 7db54cc96b..fda20bcd5b 100644 --- a/app/src/RelayEnvironment.ts +++ b/app/src/RelayEnvironment.ts @@ -9,7 +9,10 @@ import { function getSanitizedPath(path: string): string { return path.endsWith("/") ? path.slice(0, -1) : path; } -const graphQLPath = getSanitizedPath(window.Config.basename) + "/graphql"; +const graphQLPath = + `${window.location.protocol}//${window.location.host}${getSanitizedPath(window.Config.basename)}` + + "/graphql"; + /** * Relay requires developers to configure a "fetch" function that tells Relay how to load * the results of GraphQL queries from your server (or other data source). See more at diff --git a/src/phoenix/server/main.py b/src/phoenix/server/main.py index c5aaec8dbc..0238fec057 100644 --- a/src/phoenix/server/main.py +++ b/src/phoenix/server/main.py @@ -185,14 +185,15 @@ def _get_pid_file() -> Path: trace_dataset_name = args.trace_fixture simulate_streaming = args.simulate_streaming - host = args.host or get_env_host() - + host: Optional[str] = args.host or get_env_host() + display_host = host or "localhost" # If the host is "::", the convention is to bind to all interfaces. However, uvicorn # does not support this directly unless the host is set to None. - if ":" in host: + if host and ":" in host: # format IPv6 hosts in brackets display_host = f"[{host}]" if host == "::": + # TODO(dustin): why is this necessary? it's not type compliant host = None port = args.port or get_env_port() @@ -250,7 +251,7 @@ def _get_pid_file() -> Path: initial_spans=fixture_spans, initial_evaluations=fixture_evals, ) - server = Server(config=Config(app, host=host, port=port)) + server = Server(config=Config(app, host=host, port=port)) # type: ignore Thread(target=_write_pid_file_when_ready, args=(server,), daemon=True).start() # Print information about the server