0
我已编辑的代码从下面的链接沃森发现服务始终连接到默认服务
https://github.com/watson-developer-cloud/discovery-nodejs
我已经改变了环境变量和发现服务的用户名和密码。
但是,在运行代码时,它始终转到默认服务(它在上面的链接中指定的服务)而不是我特定的发现服务。 Default service
我已编辑的代码从下面的链接沃森发现服务始终连接到默认服务
https://github.com/watson-developer-cloud/discovery-nodejs
我已经改变了环境变量和发现服务的用户名和密码。
但是,在运行代码时,它始终转到默认服务(它在上面的链接中指定的服务)而不是我特定的发现服务。 Default service
取决于您的默认服务。如果您正在讨论服务端点,那么在实例化DiscoveryV1类时,在文件app.js中添加您正在使用的端点的url说明符。
const discovery = new DiscoveryV1({
// If unspecified here, the DISCOVERY_USERNAME and
// DISCOVERY_PASSWORD env properties will be checked
// After that, the SDK will fall back to the bluemix-provided VCAP_SERVICES environment property
// username: '<username>',
// password: '<password>',
version_date: '2016-11-09',
url: '<endpoint>',
qs: { aggregation: `[${queryBuilder.aggregations.join(',')}]` }
});
嗨, 感谢您的回复。 我已更新我的帖子。 '我的意思是'默认服务',它是指示例代码中提到的发现服务,而不是指我们的'必需发现服务'。我提到的网址,但仍然无法正常工作。 – Aravinth
查看.env文件:cf ssh APPNAME -c“cat .env” – jacques
in .env文件我只有发现用户名,密码,环境ID和集合ID – Aravinth