[英]Deployed Node app to OpenShift successfully, OpenShift still shows default page
So here are the steps I've taken so far: 因此,这是我到目前为止采取的步骤:
I still see the default landing page: 我仍然看到默认的登录页面:
The only odd thing I see in the deployment logs this warning, which makes no senses because it's not my code doing that (I'm basically just trying to deploy the sample app from Express) 我在部署中看到的唯一奇怪的东西记录了此警告,这是没有意义的,因为这不是我的代码执行的(我基本上只是在尝试从Express部署示例应用程序)
Any ideas as to what could be causing this? 关于什么可能导致此的任何想法? I'm trying to dump Heroku but can't get basic things to work.
我正在尝试转储Heroku,但无法使基本功能正常工作。
UPDATE : I found this KB article which explains how to run your own file (why this information isn't better documented and part of the basic tutorial is beyond me). 更新 :我发现这篇知识库文章解释了如何运行自己的文件(为什么这些信息没有得到更好的记录,而基础教程的一部分超出了我的理解)。 It is still unclear to me whether the code in server.js is needed or not... Or I'm expected to always use server.js as a shell to all my code.
对我来说仍然不清楚,是否需要server.js中的代码……或者我应该总是将server.js用作我所有代码的外壳。
https://www.openshift.com/kb/kb-e1048-how-can-i-run-my-own-nodejs-script https://www.openshift.com/kb/kb-e1048-how-can-i-run-my-own-nodejs-script
I found the answer here: 我在这里找到了答案:
https://www.openshift.com/blogs/run-your-nodejs-projects-on-openshift-in-two-simple-steps https://www.openshift.com/blogs/run-your-nodejs-projects-on-openshift-in-two-simple-steps
The gist of it is this: 要点是:
app.set('port', process.env.OPENSHIFT_NODEJS_PORT || 8080); app.set('ip', process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1');
and then 接着
http.createServer(app).listen(app.get('port'), app.get('ip'), function(){ console.log('Express server listening on port ' + app.get('port')); });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.