aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/cognitive_services/CognitiveServices.ts2
-rw-r--r--src/server/index.ts15
2 files changed, 1 insertions, 16 deletions
diff --git a/src/client/cognitive_services/CognitiveServices.ts b/src/client/cognitive_services/CognitiveServices.ts
index af5fb39fc..e74aef998 100644
--- a/src/client/cognitive_services/CognitiveServices.ts
+++ b/src/client/cognitive_services/CognitiveServices.ts
@@ -38,7 +38,7 @@ export enum Confidence {
export namespace CognitiveServices {
const ExecuteQuery = async <D>(service: Service, manager: APIManager<D>, data: D): Promise<any> => {
- return fetch(Utils.prepend(`cognitiveServices/${service}`)).then(async response => {
+ return fetch(Utils.prepend(`environment/${service}`)).then(async response => {
let apiKey = await response.text();
if (!apiKey) {
console.log(`No API key found for ${service}: ensure index.ts has access to a .env file in your root directory`);
diff --git a/src/server/index.ts b/src/server/index.ts
index 8fc402cc9..d68e9faa1 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -100,21 +100,6 @@ function routeSetter(router: RouteManager) {
}
});
- const ServicesApiKeyMap = new Map<string, string | undefined>([
- ["face", process.env.FACE],
- ["vision", process.env.VISION],
- ["handwriting", process.env.HANDWRITING]
- ]);
-
- router.addSupervisedRoute({
- method: Method.GET,
- subscription: new RouteSubscriber("cognitiveServices").add('requestedService'),
- onValidation: ({ req, res }) => {
- let service = req.params.requestedService;
- res.send(ServicesApiKeyMap.get(service));
- }
- });
-
const EndpointHandlerMap = new Map<GoogleApiServerUtils.Action, GoogleApiServerUtils.ApiRouter>([
["create", (api, params) => api.create(params)],
["retrieve", (api, params) => api.get(params)],