How do I setup routing for react in GAE? Directly routing to react-router-dom routes via URL fails in GAE on basic create-react-app?

后端 未结 4 2006
星月不相逢
星月不相逢 2020-12-05 19:03

ANSWER for now

This was tough for me to get exactly right. Very little in the way of guidance via Google. I hope this helps others.

As D

4条回答
  •  有刺的猬
    2020-12-05 19:42

    I spent some time on this and this works perfectly for my React CRA on GAE Standard.

    runtime: nodejs10
    service: bbi-staging
    env: standard
    instance_class: F2
    handlers:
      - url: /(.*\.(gif|media|json|ico|eot|ttf|woff|woff2|png|jpg|css|js))$
        static_files: build/\1
        upload: build/(.*)
      - url: /(.*)
        static_files: build/index.html
        upload: build/index.html
    

提交回复
热议问题