Google云平台应用部署导致502服务器错误
Google Cloud Platform App Deployment Resulted in 502 Server Error
在确保我的 RESTful API 在本地正常工作后,我按照以下指南中的说明进行了部署:
https://cloud.google.com/nodejs/getting-started/hello-world
...我相信我做对了。之后我得到了以下屏幕
gcloud 应用部署
完成 运行.
遗憾的是,https://_project-id.appspot.com(或命令行上的 gcloud app browse)一直导致 502 服务器错误:
错误:服务器错误
服务器遇到临时错误,无法完成您的请求。
请在 30 秒后重试。
(是的,我又试了很多次)
============================================= ===========
编辑:
当我检查部署管理器时,它说:
您还没有任何部署。
这里会有什么问题?
app.yaml
# Copyright 2015-2016, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# [START runtime]
runtime: nodejs
env: flex
# [END runtime]
package.json
{
"name": "plusfriend",
"version": "1.0.0",
"description": "Jjalkey Kakao Plus Friend/YellowID RESTful API",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"body-parser": "*",
"express": "4.14.1",
"mongoose": "4.8.1",
"gcloud": "^0.37.0"
},
"author": "Edward Joon-Hyuk Chang",
"license": "ISC"
}
server.js的最后一部分
// Listen
app.listen(80);
有什么想法吗?
非常感谢您。
至于这个问题,我只是重构了一切。您可以在此处查看文件:https://github.com/edwardjhchang/Jjalkey-Kakao-Talk-Plus-Friend-Auto-Reply-API
最重要的是,您必须创建 var http = require('http');
(我最初没有意识到)。查看我的存储库以获取更多详细信息:D
在确保我的 RESTful API 在本地正常工作后,我按照以下指南中的说明进行了部署: https://cloud.google.com/nodejs/getting-started/hello-world
...我相信我做对了。之后我得到了以下屏幕 gcloud 应用部署 完成 运行.
遗憾的是,https://_project-id.appspot.com(或命令行上的 gcloud app browse)一直导致 502 服务器错误:
错误:服务器错误
服务器遇到临时错误,无法完成您的请求。 请在 30 秒后重试。
(是的,我又试了很多次)
============================================= =========== 编辑: 当我检查部署管理器时,它说: 您还没有任何部署。
这里会有什么问题?
app.yaml
# Copyright 2015-2016, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# [START runtime]
runtime: nodejs
env: flex
# [END runtime]
package.json
{
"name": "plusfriend",
"version": "1.0.0",
"description": "Jjalkey Kakao Plus Friend/YellowID RESTful API",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"body-parser": "*",
"express": "4.14.1",
"mongoose": "4.8.1",
"gcloud": "^0.37.0"
},
"author": "Edward Joon-Hyuk Chang",
"license": "ISC"
}
server.js的最后一部分
// Listen
app.listen(80);
有什么想法吗? 非常感谢您。
至于这个问题,我只是重构了一切。您可以在此处查看文件:https://github.com/edwardjhchang/Jjalkey-Kakao-Talk-Plus-Friend-Auto-Reply-API
最重要的是,您必须创建 var http = require('http');
(我最初没有意识到)。查看我的存储库以获取更多详细信息:D