在Heroku上运行firebase节点应用程序时出错

时间:2016-10-21 01:53:29

标签: node.js heroku firebase server firebase-realtime-database

代码(server.js)如下面的Firebase文档示例

var firebase = require("firebase");
firebase.initializeApp({
  databaseURL: "https://mydatabaseName.firebaseio.com",
});

var db = firebase.database();
var ref = db.ref("/Users");
ref.on("value", function(snapshot) {
  console.log(snapshot.val());
});

但我遇到了错误

Error waiting for process to terminate: No child processes
State changed from starting to crashed
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
Stopping process with SIGKILL
Process exited with status 22

在Google上搜索此问题后,我尝试添加到Procfile

worker: node server.js

heroku ps:scale worker=1 web=0

这些似乎都不起作用。有什么建议吗?

0 个答案:

没有答案
相关问题