-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update connect.yaml and edit config inside algolia-sample extension
- Loading branch information
1 parent
b6da7dc
commit 5031a5e
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
full-ingestion/src/extensions/algolia-example/configurations/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
function loadConfig() { | ||
try { | ||
return JSON.parse(process.env.SEARCH_PLATFORM_CONFIG); | ||
} catch (e) { | ||
throw new Error( | ||
'Search platform configuration is not provided in the JSON format' | ||
); | ||
} | ||
} | ||
|
||
export const config = { | ||
applicationId: process.env.AGOLIA_APPLICATION_ID, | ||
searchApiKey: process.env.AGOLIA_SEARCH_API_KEY, | ||
index: process.env.AGOLIA_INDEX, | ||
applicationId: loadConfig().applicationId, | ||
searchApiKey: loadConfig().searchApiKey, | ||
index: loadConfig().index, | ||
}; |