简体   繁体   English

Watson Discovery Service始终连接到默认服务

[英]watson discovery service always connecting to default service

I have edited the code from following link 我已经通过以下链接编辑了代码

https://github.com/watson-developer-cloud/discovery-nodejs https://github.com/watson-developer-cloud/discovery-nodejs

I have changed Environment variables and discovery service user name and password. 我更改了环境变量以及发现服务用户名和密码。

But while running the code it always goes to default service (the one it specified in the above link) not to my specific discovery service. 但是在运行代码时,它始终会使用默认服务(在上面的链接中指定的默认服务)而不是我的特定发现服务。 Default service 默认服务

Depends on what you mean by the default service. 取决于默认服务的含义。 If you are talking about the service endpoint then in the file app.js add a url specifier for the endpoint that you are using, when instantiating the DiscoveryV1 class. 如果您正在谈论服务端点,则在实例化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(',')}]` }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM