【发布时间】:2016-05-18 11:00:55
【问题描述】:
我正在构建一个必须与 youtube 数据 API 通信的 openshift 节点 js 应用程序。当我对 require 进行“git push”时,它的部署是成功的。
/*
var request = require('request');
*/
当我取消注释时,我收到此错误:
remote: Waiting for application port (8080) become available ...
remote: Application 'eln' 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: 573c3e177628e146d400004e (Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/573c3e177628e146d400004e/nodejs
我做得不好吗?我该如何解决?
谢谢。
编辑1:添加监听代码,我没有修改(我创建应用时已经在这里)。
self.ipaddress = process.env.OPENSHIFT_NODEJS_IP;
self.port = process.env.OPENSHIFT_NODEJS_PORT || 8080;
/**
* Start the server (starts up the sample application).
*/
self.start = function()
{
// Start the app on the specific interface (and port).
self.app.listen(self.port, self.ipaddress, function()
{
console.log('%s: Node server started on %s:%d ...', Date(Date.now() ), self.ipaddress, self.port);
});
};
【问题讨论】:
-
您的应用程序是否在侦听任何端口?如果是,那么请告诉我您的监听方法代码
-
在帖子中添加。
标签: javascript node.js openshift