85742ab165
Deploy Documentation / deploy (push) Has been cancelled
CPU Test / Test (Utilities, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (LLM proxy, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Others, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Store, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Utilities, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Weave, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (AgentOps, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (LLM proxy, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (Others, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (Weave, latest, Python 3.13) (push) Has been cancelled
Dashboard / Chromatic (push) Has been cancelled
CPU Test / Lint - fast (push) Has been cancelled
CPU Test / Lint - next (push) Has been cancelled
CPU Test / Lint - slow (push) Has been cancelled
CPU Test / Lint - JavaScript (push) Has been cancelled
CPU Test / Build documentation (push) Has been cancelled
CPU Test / Test (AgentOps, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (LLM proxy, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (Others, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (Store, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (Weave, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (AgentOps, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Store, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (Utilities, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (Weave, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (AgentOps, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (LLM proxy, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (Others, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (Store, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (Utilities, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (JavaScript) (push) Has been cancelled
21 lines
831 B
TypeScript
21 lines
831 B
TypeScript
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
import { setBaseUrl } from '@/features/config';
|
|
import { createAppStore, type AppStore } from '@/store';
|
|
|
|
const resolvePythonServerBaseUrl = (): string => {
|
|
const host = process.env.VITEST_PYTHON_HOST ?? '127.0.0.1';
|
|
const port = process.env.VITEST_PYTHON_PORT ?? '8765';
|
|
const configured = process.env.VITEST_PYTHON_URL;
|
|
const base = configured && configured.trim().length > 0 ? configured : `http://${host}:${port}`;
|
|
return base.replace(/\/$/, '');
|
|
};
|
|
|
|
export const getPythonServerBaseUrl = (): string => resolvePythonServerBaseUrl();
|
|
|
|
export const createServerBackedStore = (preloadedState?: Parameters<typeof createAppStore>[0]): AppStore => {
|
|
const store = createAppStore(preloadedState);
|
|
store.dispatch(setBaseUrl(getPythonServerBaseUrl()));
|
|
return store;
|
|
};
|