GatsbyJs client only paths goes to 404 page when the url is directly accessed in browser in “production”

前端 未结 4 1740
谎友^
谎友^ 2020-12-28 15:44

I have created a Gatsby app and configured gatsby-node.js to a create client only paths, which are all working fine in development while directly accessing the

4条回答
  •  余生分开走
    2020-12-28 16:36

    For Firebase hosting, I added the following to my firebase.json:

    "rewrites": [
      {
          "source": "**",
          "destination": "/loading/index.html"
      }
    

    ]

    Then I created a new loading.js file under /page. With this configuration, Firebase first responds with loading.html then Gatsby handles the client routing.

提交回复
热议问题