【发布时间】:2018-11-01 07:02:01
【问题描述】:
我正在使用 Firebase 托管 SPA (create-react-app) 我想在 url ex 中获取参数动态:https://www.exmaple.com/home/:id
我关注文档:https://firebase.google.com/docs/hosting/full-config#section-glob
所以我在 firebase.json 中有代码
{
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"redirects": [
{
"source": "/home/:id",
"type" : 301,
"destination": "/home/:id"
}
]
}
}
结果是我得到 ERR_TOO_MANY_REDIRECT,当我查看网络中的调试器工具时,它重定向到相同的路径。
我试过了,输入 301、302 甚至重写属性然后得到 404 响应。
【问题讨论】:
标签: firebase firebase-realtime-database routing google-cloud-functions firebase-hosting