OpenShift上的Node.js主机保持"服务暂时不可用"

时间:2015-11-04 07:30:02

标签: node.js express openshift

我正在尝试在Openshift上托管一个node.js项目,这是我的package.json



"scripts": {
    "start": "node index.js"
  },
"main": "index.js",
"dependencies": {
"express": "^4.13.3",
"formidable": "^1.0.17"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
...




这是我的index.js



var express = require('express');
var app = express();
var http = require('http');

app.set('port', process.env.OPENSHIFT_NODEJS_PORT || process.env.PORT || 8080);
app.set('ip', process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1");


app.get('/', function(req,res){
	res.send("Hello World");
});


http.createServer(app).listen(app.get('port') ,app.get('ip'), function () {
    console.log("✔ Express server listening at %s:%d ", app.get('ip'),app.get('port'));
    server();
});




我缺少什么,我怎样才能成功地看到预期的" Hello World"信息?谢谢!

1 个答案:

答案 0 :(得分:0)

我没有发现你的能力有任何问题,我打赌“Service Temporarily Unavailable”就是说,在这种情况下。只需在计划维护后再试一次。

另外,请检查http://status.openshift.com/或@openshift_ops

上的预定维护