我正在开发一个网站,它应该向 iOS 设备发送推送通知。我按照本教程发送通知。在我的 localhost apnagent 上工作正常,但是当我git push
访问我的 Openshift 云时,我在终端中收到以下错误:
remote: Waiting for application port (8080) become available ...
remote: Application 'apnagent' failed to start (port 8080 not available)
remote: -------------------------
remote: Git Post-Receive Result: failure
remote: Activation status: failure
remote: Activation failed for the following gears:
remote: 55c3344c89f5cf720xxxxxxx (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/55c3344c89f5cf720xxxxxxx/nodejs
remote: #<IO:0x00000000f1c278>
remote: #<IO:0x00000000f1c200>
remote: )
remote: Deployment completed with status: failure
remote: postreceive failed
To ssh://55c3344c89f5cf720xxxxxxx@apnagent-xxxxxxx.rhcloud.com/~/git/apnagent.git/
bbcf2a3..87exxxx master -> master
我的 package.json 看起来像这样:
{
"private": true,
"name": "apnagent",
"version": "0.0.0",
"dependencies": {
"apnagent": "1.0.x"
},
"engines": {
"node": ">=0.10.22",
"npm": ">=1.3.14"
},
"scripts": {
"start": "node agent/_header.js"
},
"main": "agent/_header.js"
}
我想我应该以某种方式process.env.OPENSHIFT_NODEJS_PORT
用作服务器上的端口,或者类似的东西。我敢肯定,我犯了一些配置错误,因为在我的本地机器上一切正常。