OpenShift conf

This commit is contained in:
Thomas FORGIONE 2015-05-06 16:51:39 +02:00
parent 3cc8e15aaa
commit b0e9d6b7ec
1 changed files with 5 additions and 3 deletions

View File

@ -40,13 +40,15 @@ app.use(function(req, res) {
}); });
// Set ports and ip adress // Set ports and ip adress
var server_port, server_ip_adress; var server_port, server_ip_address;
if ( app.get('env') === 'development' ) { if ( app.get('env') === 'development' ) {
server_port = 4000; server_port = 4000;
server_ip_adress = 'localhost'; server_ip_address = 'localhost';
} else { } else {
// Openhift conf
server_port = process.env.OPENSHIFT_NODEJS_PORT || 8080; server_port = process.env.OPENSHIFT_NODEJS_PORT || 8080;
server_ip_address = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1'; server_ip_address = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1';
} }
app.listen(server_port, server_ip_adress); console.log("Starting server on " + server_ip_address + ":" + server_port);
app.listen(server_port, server_ip_address);