I'm doing this simple test on my nodejs app in Openshift. The code below was running fine and I was able to see index.html, until I added the line var io = require('socket.io').listen(http);. Now I'm getting the 503 - Service Temporarily Unavailable. I have socket.io installed in the app-root/repo/node_modules folder, and I've also included it to dependencies in package.json. What could be wrong?
var express = require('express');
var app = express();
var http = require('http').Server(app);
var server_port = process.env.OPENSHIFT_NODEJS_PORT || 8080;
var server_ip_address = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1';
var io = require('socket.io').listen(http);
app.get('/', function(req, res) {
res.sendfile('index.html');
});
http.listen(server_port, server_ip_address);
Your code works OK on my machine. Double check the dependencies, and above all the logs:
ssh to your gear
less app-root/logs/nodejs.log