【发布时间】:2019-02-11 05:34:23
【问题描述】:
我使用 React 和 Node.js 8 为 Google App Engine 开发了一个简单的应用程序。它在灵活环境中运行良好,但如果我尝试在标准环境中部署它,我会收到“GET / HTTP/1.1”500 错误。除此之外,我找不到更多关于出了什么问题的信息。
如何配置它以使其在标准环境中工作?
app.standard.yaml
runtime: nodejs8
handlers:
- url: /
script: src/index.js
- url: /src
script: index.js
package.json
{
"name": "eventpub",
"version": "0.1.0",
"private": true,
"engines": {
"node": "8.x.x"
},
"dependencies": {
"node-pre-gyp": "^0.11.0",
"npm": "^5.6.0",
"react": "^16.4.2",
"react-collapsible": "^2.3.1",
"react-dom": "^16.4.2",
"react-json-viewer": "^1.7.1",
"react-scripts": "1.1.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
项目文件夹结构
node_modules
public
- public/index.html
- public/manifest.json
src
- src/App.css
- src/App.js
- src/App.test.js
- src/index.css
- src/index.js
- src/registerServiceWorker.js
.gcloudignore
.gitignore
app.flexible.yaml
app.standard.yaml
package.json
package-lock.json
README.md
【问题讨论】:
标签: node.js reactjs google-app-engine google-cloud-platform