【问题标题】:Not able to run nodejs project on google app engine无法在谷歌应用引擎上运行 nodejs 项目
【发布时间】:2017-05-11 10:25:57
【问题描述】:

我刚刚使用 nodejs 启动了谷歌应用引擎。我创建了一个在我的机器上运行良好的本地项目。如果我打

http://localhost:7000/services/user/getuser

它返回一个 json 对象。

我已经使用

在谷歌应用引擎上部署了相同的项目
gcloud app deploy

现在当我点击

http://help-coin.appspot.com/services/user/getuser

它正在显示

Error: Server Error

The server encountered a temporary error and could not complete your request.
Please try again in 30 seconds.

我已经检查了服务器上的日志

Load controllers from path '/app/app/services' non recursive.

--------make-runnable-output--------

undefined

------------------------------------

Up and running on port 7000

Loading controller 'UserService.js'.

服务器端没有错误。这是什么问题?我错过了什么吗?

这里是我部署的项目https://github.com/ermarkar/nodejs-typescript-sample

【问题讨论】:

    标签: node.js google-app-engine


    【解决方案1】:

    您的应用必须监听 8080,而不是 7000 或任何其他端口。

    this

    监听 8080 端口

    App Engine 前端会将传入请求路由到端口 8080 上的相应模块。您必须确保您的应用程序代码正在侦听 8080。

    【讨论】:

    • 有什么方法可以改变端口以在 7000 上工作吗?
    • @SunilGarg 我不这么认为。 8080有什么问题?
    猜你喜欢
    • 2011-10-08
    • 1970-01-01
    • 2014-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-13
    • 1970-01-01
    相关资源
    最近更新 更多