I am trying out to host a node.js project on Openshift, here is my 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" }, ...
and here is my 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(); });
What am I missing and how can I successfully see the expected "Hello World" message? Thanks!
I don't see anything wrong with your could, and I bet “Service Temporarily Unavailable”
means exactly that, in this case. Simply try again later after the scheduled maintenance.
Also, check the scheduled maintenances at http://status.openshift.com/ or @openshift_ops
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.