Flutter Web 路由在 Firebase 托管部署后不起作用

问题描述 投票:0回答:0

在 firebase 托管上部署我的 flutter web 应用程序后,路由似乎已停止工作。专门尝试导航到这样的页面:

https://example.com/blogpost/{blog post id} 将我带到 404 未找到页面。

我不得不添加这是 firebase.json 文件,因为我们之前的开发人员没有帮助我们如何部署网站:

{
  "hosting": {
    "public": "build/web",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}
flutter firebase firebase-hosting
© www.soinside.com 2019 - 2024. All rights reserved.