簡體   English   中英

將create-react-app構建部署到Google Cloud Platform后找不到URL

[英]URLs not found after deploying create-react-app build to Google Cloud Platform

我已將create-react-app構建(帶有app.yaml文件)上傳到GCP存儲桶。 然后,該應用已使用雲外殼部署在App Engine實例上。

轉到應用程序的根URL可以正常工作。 但是轉到example.com/anything返回以下錯誤:

錯誤:找不到

在此服務器上找不到請求的URL /任何內容。

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

您沒有/anything的處理程序。 如果要使用全部網址,請使用正則表達式類型處理程序:

- url: /.*
  static_files: build/index.html
  upload: build/index.html

或者,如果您想將它們anything.html作為靜態文件提供,請將其放在build目錄中,然后導航至/anything.html 您的第一個處理程序已設置為映射該URL。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM