Skip to content

Commit 92c12d2

Browse files
willholleyglynnbird
authored andcommitted
(#58) - prefer SSS_CLOUDANT_URL over VCAP_SERVICES (#59)
1 parent d4273d4 commit 92c12d2

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

lib/credentials.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,7 @@
22
CLOUDANT
33
*******/
44

5-
// VCAP_SERVICES
6-
// This is Bluemix configuration
7-
if (typeof process.env.VCAP_SERVICES === 'string') {
8-
console.log("Using Bluemix config for Cloudant");
9-
var services = process.env.VCAP_SERVICES;
10-
if (typeof services !== 'undefined') {
11-
services = JSON.parse(services);
12-
}
13-
}
14-
15-
// SSS_CLOUDANT_URL
16-
// Local deploy cloudant configuration
17-
// URL format: https://<username>:<password>@<hostname>
18-
else if (typeof process.env.SSS_CLOUDANT_URL === 'string') {
5+
if (typeof process.env.SSS_CLOUDANT_URL === 'string') {
196
console.log("Using local config for Cloudant");
207
var services = {
218
"cloudantNoSQLDB": [{
@@ -29,4 +16,14 @@ else if (typeof process.env.SSS_CLOUDANT_URL === 'string') {
2916
};
3017
}
3118

19+
// VCAP_SERVICES
20+
// This is Bluemix configuration
21+
else if (typeof process.env.VCAP_SERVICES === 'string') {
22+
console.log("Using Bluemix config for Cloudant");
23+
var services = process.env.VCAP_SERVICES;
24+
if (typeof services !== 'undefined') {
25+
services = JSON.parse(services);
26+
}
27+
}
28+
3229
module.exports = services;

0 commit comments

Comments
 (0)