I have deployed my react app to GCP's App engine. It successfully deploys and the landing page is accessible. However none of the routes work. All the routes are giving '404' error. I am pretty sure its the app.yaml configuration that has issue. Help please!
runtime: nodejs10
handlers:
- url: /
static_files: build/index.html
upload: build/index.html
- url: /
static_dir: build
The issue is that you are using both static_files
and static_dir
to your /
url.
You need to either use static_files
or static_dir
.
From the description of your question it looks like you want to use static_dir
to match everything that is inside the directory after the url: /
.
As stated in the documentation:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.