2016-04-06 14 views
0

Ben bluemix benim açısal ekspres web uygulaması itmeye çalışıyorum, ancak bu hatayıPushing uygulaması hayır

2016-04-05T20:12:50.96-0300 [App/0]  OUT > angular-expess-seed- 
[email protected] start /home/vcap/app 
2016-04-05T20:12:50.96-0300 [App/0]  OUT > node app.js 
2016-04-05T20:12:51.19-0300 [App/0]  OUT Express server listening  
on port 3000 in production mode 
2016-04-05T20:13:50.37-0300 [DEA/34]  ERR Instance (index 0) failed  
to start accepting connections 
2016-04-05T20:13:50.39-0300 [API/2]  OUT App instance exited with  
guid b3554c4b-11f5-433f-891e-1df16605df80 payload: 
{"cc_partition"=>"default", "droplet"=>"b3554c4b-11f5-433f-891e- 
1df16605df80", "version"=>"36d8b569-d38a-465d-8bc6-b14ffd13b413", 
"instance"=>"dbd3566e0ef348d9b9f483a32e8fed89", "index"=>0, 
"reason"=>"CRASHED", "exit_status"=>-1, "exit_description"=>"failed to 
accept connections within health check timeout", 
"crash_timestamp"=>1459898030} 
2016-04-05T20:13:50.40-0300 [App/0]  ERR 
2016-04-05T20:14:16.36-0300 [DEA/24]  OUT Starting app instance  
    (index 0) with guid b3554c4b-11f5-433f-891e-1df16605df80 

Önce başlangıç ​​komut dosyası hakkında şikayetçi oldu alıyorum ben parçası olduğunu ancak çözdüm eksik bluemix için Bu hata ile böyle.

cevap

2

aşağıda hatadan görebilirsiniz: node.js uygulama yerel ortamda çalışan port 3000 yılında dinlemeye çalışıyor

Express server listening  
on port 3000 in production mode 

ama bluemix için size gelen portu almak zorunda Bulut Döküm (CF) ortamı. İşte

yapmak için bir örnek kod şudur:

// cfenv provides access to your Cloud Foundry environment 
// for more info, see: https://www.npmjs.com/package/cfenv 
var cfenv = require('cfenv'); 

// get the app environment from Cloud Foundry 
var appEnv = cfenv.getAppEnv(); 

// start server on the specified port and binding host 
app.listen(appEnv.port, '0.0.0.0', function() { 

     // print a message when the server starts listening 
    console.log("server starting on " + appEnv.url); 
}); 
+0

Teşekkür @Alex da Silva –