2016-04-06 10 views
0

Ich versuche, meinen Winkel Express Web-App zu drücken, um Bluemix, aber ich erhalte diesen FehlerPushing App Bluemix

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 

Zuerst war es über das Startskript beschwert fehle Ich habe das Teil fest, aber keine so mit diesem Fehler.

Antwort

2

kann ich von dem Fehler siehe unten:

Express server listening  
on port 3000 in production mode 

, die Ihre Node.js Anwendung in Port 3000. zu hören versucht, die in lokaler Umgebung funktioniert, aber für Bluemix haben Sie den Hafen von dem bekommen Cloud Foundry (CF) -Umgebung.

Hier ist ein Beispielcode zu tun, dass:

// 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

Dank @ Alex da Silva –