Skip to content

Commit

Permalink
docs: fix authentication error on live examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dpopp07 authored and germanattanasio committed Apr 22, 2019
1 parent 01304b7 commit 64d8ee1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ var sttAuthService = new AuthorizationV1(
{
username: process.env.SPEECH_TO_TEXT_USERNAME, // or hard-code credentials here
password: process.env.SPEECH_TO_TEXT_PASSWORD,
iam_apikey: process.env.SPEECH_TO_TEXT_IAM_APIKEY, // if using an RC service
// iam_apikey: process.env.SPEECH_TO_TEXT_IAM_APIKEY, // if using an RC service
url: process.env.SPEECH_TO_TEXT_URL ? process.env.SPEECH_TO_TEXT_URL : SpeechToTextV1.URL
},
vcapServices.getCredentials('speech_to_text') // pulls credentials from environment in bluemix, otherwise returns {}
)
);
app.use('/api/speech-to-text/token', function(req, res) {
sttAuthService.getToken({}, function(err, token) {
sttAuthService.getToken(function(err, token) {
if (err) {
console.log('Error retrieving token: ', err);
res.status(500).send('Error retrieving token');
Expand All @@ -119,7 +119,7 @@ var ttsAuthService = new AuthorizationV1(
)
);
app.use('/api/text-to-speech/token', function(req, res) {
ttsAuthService.getToken({}, function(err, token) {
ttsAuthService.getToken(function(err, token) {
if (err) {
console.log('Error retrieving token: ', err);
res.status(500).send('Error retrieving token');
Expand Down

0 comments on commit 64d8ee1

Please sign in to comment.