【发布时间】:2018-06-09 10:49:01
【问题描述】:
我已将 create-react-app 构建(带有 app.yaml 文件)上传到 GCP 存储桶。然后,该应用已使用 Cloud Shell 部署在 App Engine 实例上。
转到应用的根 URL 可以正常工作。但是转到example.com/anything 会返回以下错误:
错误:未找到
在此服务器上找不到请求的 URL /anything。
App.yaml 文件如下所示:
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /(.*\.(html|css|js))
static_files: build/\1
upload: build/(.*\.(html|css|js))
- url: /
static_files: build/index.html
upload: build/index.html
【问题讨论】:
-
使用
url: .*作为第二个处理程序。 -
嗨@typeofgraphic,你能分享一下如何逐步将create-react-app部署到Google App Engine吗?谢谢
标签: reactjs google-app-engine google-cloud-platform google-cloud-storage create-react-app