Skip to content

Commit

Permalink
feat(token-server): add platformUrl to .env file (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
y-lakhdar authored Feb 18, 2021
1 parent 491eeb5 commit ef167e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 4 additions & 0 deletions packages/search-token-server/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# The Plaform URL to use.
# See https://docs.coveo.com/en/2976/coveo-solutions/deployment-regions-and-strategies
PLATFORM_URL=https://platform.cloud.coveo.com

# The unique identifier of the organization in which to generate a search token.
# Example: ORGANIZATION_ID=mycoveoorganizationg8tp8wu3.
# See https://docs.coveo.com/en/148/manage-an-organization/retrieve-the-organization-id
Expand Down
18 changes: 7 additions & 11 deletions packages/search-token-server/middlewares/searchToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ require('abortcontroller-polyfill');
import {Request, Response, NextFunction} from 'express';
import {
PlatformClient,
Environment,
Region,
RestUserIdType,
TokenModel,
} from '@coveord/platform-client';
Expand All @@ -19,19 +17,17 @@ export function ensureTokenGenerated(
req.app.locals.platform ||
new PlatformClient({
/**
* The target environment.
* The platform.cloud.coveo.com is the default target host.
* However, you can target a different host by changing the environment.
* The Plaform URL to use.
* https://platform.cloud.coveo.com is the default platform host.
* However, you can target a different environment by changing the host value.
*
* Example:
* environment: Environment.hipaa will target the HIPAA host (platformhipaa.cloud.coveo.com)
*/
environment: Environment.prod,
/**
* The target region.
* Use "https://platformhipaa.cloud.coveo.com" if you want to target the HIPAA environment.
*
* You can also target a different region (e.g. https://platform-au.cloud.coveo.com)
* See https://docs.coveo.com/en/2976/coveo-solutions/deployment-regions-and-strategies#data-residency
*/
region: Region.US,
host: process.env.PLATFORM_URL,
/**
* The unique identifier of your Coveo organization.
* To retrieve your org ID, see https://docs.coveo.com/en/148/manage-an-organization/retrieve-the-organization-id
Expand Down

0 comments on commit ef167e4

Please sign in to comment.