3

I've uploaded a create-react-app build (with an app.yaml file) to a GCP bucket. The app has then been deployed on a App Engine instance using the cloud shell.

Going to the app's root URL works fine. But going to example.com/anything returns the following error:

Error: Not Found

The requested URL /anything was not found on this server.

App.yaml file looks like this:

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
Community
  • 1
  • 1
typeofgraphic
  • 312
  • 4
  • 11

1 Answers1

8

You don't have a handler for /anything. If you want a catch-all url, use regex type handler:

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

or, if you want to serve them anything.html as a static file, put it in your build dir, and navigate to /anything.html. Your first handler is set up to map that url.

GAEfan
  • 11,244
  • 2
  • 17
  • 33