Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Commit 4e5f9bb

Browse files
fix: Add iam_url to constructor
1 parent 9904803 commit 4e5f9bb

File tree

5 files changed

+19
-149
lines changed

5 files changed

+19
-149
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ DISCOVERY_USERNAME=
33
DISCOVERY_PASSWORD=
44
# OR IAM API key and URL
55
DISCOVERY_IAM_APIKEY=
6-
DISCOVERY_IAM_URL=
6+
DISCOVERY_IAM_URL=https://iam.bluemix.net/identity/token
77

88

99
ENVIRONMENT_ID=<environment>
1010
COLLECTION_ID=<collection>
11+
# check your credentials to validate the url below is correct
1112
DISCOVERY_URL=https://gateway.watsonplatform.net/discovery/api

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (process.env.DISCOVERY_IAM_APIKEY && process.env.DISCOVERY_IAM_APIKEY !== '')
1111
discovery = new DiscoveryV1({
1212
version: '2017-08-01',
1313
iam_apikey: process.env.DISCOVERY_IAM_APIKEY || '<iam_apikey>',
14-
iam_url: 'https://iam.bluemix.net/identity/token',
14+
iam_url: process.env.DISCOVERY_IAM_URL || 'https://iam.bluemix.net/identity/token',
1515
url: process.env.DISCOVERY_URL || 'https://gateway.watsonplatform.net/discovery/api',
1616
});
1717
} else {

package-lock.json

Lines changed: 16 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"express-rate-limit": "^2.9.0",
3636
"express-secure-only": "^0.2.1",
3737
"helmet": "^3.8.1",
38-
"metrics-tracker-client": "^0.4.1",
3938
"moment": "^2.17.1",
4039
"morgan": "^1.7.0",
4140
"prop-types": "^15.5.10",

server.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
#! /usr/bin/env node
22

33
require('dotenv').config({ silent: true });
4-
const tracker = require('metrics-tracker-client');
5-
6-
// Deployment tracking
7-
if (!process.env.DEMO_DEPLOY) {
8-
tracker.track();
9-
}
10-
114
const app = require('./app');
125

136
const port = process.env.PORT || 5000;
14-
157
const server = app.listen(port, () => {
168
// eslint-disable-next-line no-console
179
console.log('Server running on port: %d', port);

0 commit comments

Comments
 (0)