我编写了一个使用云端点的Java App Engine应用程序。我想通过Node.js应用程序与这些端点通信。是否可以使用google-api-nodejs-client来实现此目的?
我已经试过了:
var googleapis = require('googleapis');
googleapis
.discover('myapiname', 'v1dev', {baseDiscoveryUrl: 'http://localhost:8888/_ah/api/discovery/v1/apis/'})
.execute(function(err, client) {
console.log(err);
console.log(client);
client.myapiname.domains.list().execute(function(err, resp) {
console.log(resp);
});
});但是库没有发现我的端点,err和client的回调返回null:
{ clients: [],
ops: {},
authClient: null,
undefined:
{ apiMeta: '<html><head><title>Error 404</title></head>\n<body><h2>Error 404</h2></body>\n</html>',
authClient: null,
defaultParams: null } }我已经用'myapiname‘替换了我的真实api名称,当然,URL是可访问的(如果我在同一台计算机上的浏览器中打开它,它会返回正确的http://localhost:8888/_ah/api/discovery/v1/apis/ )。
发布于 2014-07-10 02:06:34
你有没有尝试过在谷歌应用引擎上的某个虚拟机上部署相同的代码。我对我们的应用程序引擎url也做了同样的尝试,它的效果很不错。
https://stackoverflow.com/questions/22474301
复制相似问题