Friday 9 June 2017

Openshift pod continuously restart with message "Crash loop back off" for my node js application

I have deployed the following simple code as an openshift application but it crashes and restarts continuously

var express = require('express');
var app = express();
app.set('view engine', 'ejs');

var server_port = process.env.OPENSHIFT_NODEJS_PORT || 8080;
var server_ip_adress = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1';


app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html');
});

app.get('/name/:name', function(req, res){
  res.render('profile', {name: req.params.name});
});

app.listen(server_port, server_ip_adress, function(){
  console.log("Listening on " + server_ip_adress + ", on port " +             server_port);
});

The following message is displayed in the openshift log Log screenshot

As I am new to Openshift and Node.js cant figure out how to solve it.



via nocmnt

No comments:

Post a Comment