Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 64750b6

Browse files
Froilan IrizarryFroilan Irizarry
authored andcommitted
Get elasticsearch service name from environment
1 parent 7583ece commit 64750b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

config/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const jsonfile = require('jsonfile');
1010
*/
1111
function getElasticsearchUri(cloudFoundryEnv) {
1212
if(!cloudFoundryEnv.isLocal){
13-
const elasticSearchCredentials = cloudFoundryEnv.getServiceCreds("code_gov_elasticsearch");
13+
const serviceName = process.env.ELASTICSEARCH_SERVICE_NAME
14+
? process.env.ELASTICSEARCH_SERVICE_NAME
15+
: 'code_gov_elasticsearch';
16+
17+
const elasticSearchCredentials = cloudFoundryEnv.getServiceCreds(serviceName);
1418

1519
return elasticSearchCredentials.uri
1620
? elasticSearchCredentials.uri

0 commit comments

Comments
 (0)