This commit is contained in:
artrejo
2022-01-20 18:02:41 -08:00
parent 1203427537
commit 0ffebc14ca
6 changed files with 121 additions and 71 deletions

View File

@@ -11,7 +11,7 @@ import {
getFeatureEndpointOrDefault,
queryDocuments,
readDocument,
updateDocument
updateDocument,
} from "./MongoProxyClient";
const databaseId = "testDB";

View File

@@ -337,10 +337,11 @@ export function createMongoCollectionWithProxy(
}
export function getFeatureEndpointOrDefault(feature: string): string {
const endpoint = (hasFlag(userContext.features.mongoProxyAPIs, feature) && validateEndpoint(userContext.features.mongoProxyEndpoint, allowedMongoProxyEndpoints))
? userContext.features.mongoProxyEndpoint
: configContext.MONGO_BACKEND_ENDPOINT || configContext.BACKEND_ENDPOINT;
const endpoint =
hasFlag(userContext.features.mongoProxyAPIs, feature) &&
validateEndpoint(userContext.features.mongoProxyEndpoint, allowedMongoProxyEndpoints)
? userContext.features.mongoProxyEndpoint
: configContext.MONGO_BACKEND_ENDPOINT || configContext.BACKEND_ENDPOINT;
return getEndpoint(endpoint);
}