Algolia Firebase同步 - AlgoliaSearchNetworkError :(

时间:2017-03-27 21:24:54

标签: firebase firebase-realtime-database algolia

我按照文档here访问了一个与Algolia同步Firebase的node.js客户端。一切都应该正确设置,但是当我尝试运行节点时,我收到此错误:

AlgoliaSearchNetworkError: getaddrinfo ENOTFOUND t29y6y0wwc t29y6y0wwc:443
    at ClientRequest.error (/Applications/MAMP/htdocs/bandly-algolia-firebase/node_modules/algoliasearch/src/server/builds/node.js:227:14)
    at ClientRequest.g (events.js:291:16)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:308:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at connectErrorNT (net.js:1015:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

有问题的实际代码在这里:

/**
 *  Adding or updating a record from Algolia
 */
function addOrUpdateIndexRecord(dataSnapshot) {
  // Get Firebase object
  var firebaseObject = dataSnapshot.val();
  // Specify Algolia's objectID using the Firebase object key
  firebaseObject.objectID = dataSnapshot.key;
  // Add or update object
  index.saveObject(firebaseObject, function(err, content) {
    if (err) {
      throw err;
    }
    console.log('Firebase object indexed in Algolia', firebaseObject.objectID);
  });
}

我在这里找不到什么东西?

提前致谢!

1 个答案:

答案 0 :(得分:1)

尽管实际上是尴尬,但实际上我在.env文件中犯了一个错误,并且在值周围加了引号。不要在每个属性的值周围加上引号。

现在一切正常。