首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Shopify Admin API在Google托管服务器上不起作用,但在本地主机上起作用

Shopify Admin API在Google托管服务器上不起作用,但在本地主机上起作用
EN

Stack Overflow用户
提问于 2018-05-11 22:54:20
回答 1查看 563关注 0票数 0

我的Shopify Admin API在Google托管服务器上不工作,但在本地主机上工作。我想知道我错过了什么。

我在本地主机上获得了我的订单数据,但当我将代码上传到google服务器时,它不起作用。

我正在为我的商店开发一个私人应用程序。

尝试让它工作没有任何幸运之处。

代码语言:javascript
复制
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();

const Shopify = require('shopify-api-node');
 
const shopify = new Shopify({
  shopName: 'tinyrabbithole',
  apiKey: 'your-api-key',
  password: 'your-app-password'
  // accessToken: ""
});

shopify.on('callLimits', limits => console.log(limits));
// Take the text parameter passed to this HTTP endpoint and insert it into the
// Realtime Database under the path /messages/:pushId/original
exports.getData = functions.https.onRequest((req, res) => {

shopify.order.list({ limit: 5 })
    .then( orders => {
  		console.log(orders);
  		return res.status(200).send(orders);
	})
    .catch( err => {
  		console.log(err);
  		return res.status(303).send(err);
	})
});

代码语言:javascript
复制
    { RequestError: getaddrinfo ENOTFOUND tinyrabbithole.myshopify.com tinyrabbithole.myshopify.com:443
    at ClientRequest.req.once.err (/user_code/node_modules/shopify-api-node/node_modules/got/index.js:182:22)
    at ClientRequest.g (events.js:292:16)
    at emitOne (events.js:101:20)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:310:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at connectErrorNT (net.js:1025:8)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
  name: 'RequestError',
  code: 'ENOTFOUND',
  host: undefined,
  hostname: 'tinyrabbithole.myshopify.com',
  method: 'GET',
  path: '/admin/orders.json?limit=5',
  protocol: 'https:',
  url: undefined }
EN

回答 1

Stack Overflow用户

发布于 2018-05-12 00:14:57

我会放弃这个答案,而不是把它留在评论中。如果您看到getaddrinfo ENOTFOUND错误,请首先确保您使用的是正确的付款计划。空闲层不允许传出API调用。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50295024

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档