Google App Engine Static Files Ignore if Not Found (Don't Show 404, Pass to next matching handler)

I use Nuxt.js to generate a bunch of static html and hosted these on Google App Engine.

If the path of these html files are not found, I don't want App Engine to show 404 but instead handle it using another handler which match the pattern.

Edit app.yaml

handlers:- url: /places/([\w\d-]+)  static_files: nuxt_static/\1/index.html  upload: nuxt_static/([\w\d-]+)/index.html  require_matching_file: true- url: /.*  script: application.app

Using require_matching_file: true, if /places/singapore does not have nuxt_static/singapore/index.html, the request handler is passed on to the next matching handler.

NOTE: require_matching_file: true is not documented, but it works.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.