mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-02-02 00:24:16 +00:00
Adding changes to test in a draft PR. Hopefully seeing logging of regions changing.
This commit is contained in:
@@ -91,6 +91,7 @@ export const endpoint = () => {
|
|||||||
return configContext.EMULATOR_ENDPOINT || location.origin;
|
return configContext.EMULATOR_ENDPOINT || location.origin;
|
||||||
}
|
}
|
||||||
return userContext.endpoint || userContext?.databaseAccount?.properties?.documentEndpoint;
|
return userContext.endpoint || userContext?.databaseAccount?.properties?.documentEndpoint;
|
||||||
|
// return "https://test-craig-nosql-periodic-centralus.documents.azure.com:443";
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function getTokenFromAuthService(
|
export async function getTokenFromAuthService(
|
||||||
@@ -206,12 +207,12 @@ export function client(): Cosmos.CosmosClient {
|
|||||||
|
|
||||||
const options: Cosmos.CosmosClientOptions = {
|
const options: Cosmos.CosmosClientOptions = {
|
||||||
endpoint: endpoint() || "https://cosmos.azure.com", // CosmosClient gets upset if we pass a bad URL. This should never actually get called
|
endpoint: endpoint() || "https://cosmos.azure.com", // CosmosClient gets upset if we pass a bad URL. This should never actually get called
|
||||||
// endpoint: "https://test-craig-nosql-periodic-eastus.documents.azure.com:443/",
|
// endpoint: "https://test-craig-nosql-periodic-centralus.documents.azure.com:443",
|
||||||
key: userContext.masterKey,
|
key: userContext.masterKey,
|
||||||
tokenProvider,
|
tokenProvider,
|
||||||
connectionPolicy: {
|
connectionPolicy: {
|
||||||
enableEndpointDiscovery: true,
|
enableEndpointDiscovery: true,
|
||||||
preferredLocations: ["East US", "Central US"],
|
// preferredLocations: ["East US", "Central US"],
|
||||||
connectionMode: Cosmos.ConnectionMode.Gateway,
|
connectionMode: Cosmos.ConnectionMode.Gateway,
|
||||||
// enableBackgroundEndpointRefreshing: true,
|
// enableBackgroundEndpointRefreshing: true,
|
||||||
// endpointRefreshRateInMs: 5000
|
// endpointRefreshRateInMs: 5000
|
||||||
@@ -227,6 +228,8 @@ export function client(): Cosmos.CosmosClient {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The proxy path is added as part of the dev environment.
|
||||||
|
// This is what is used to route all requests back to the global endpoint.
|
||||||
if (configContext.PROXY_PATH !== undefined) {
|
if (configContext.PROXY_PATH !== undefined) {
|
||||||
(options as any).plugins = [{ on: "request", plugin: requestPlugin }];
|
(options as any).plugins = [{ on: "request", plugin: requestPlugin }];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user