firebase - Firebase 托管重写无法正常工作
问题描述
我目前有以下配置:
// firebase.json
{
"hosting": [
{
"rewrites": [{
"source": "/articles{,/**}",
"destination": "/articles"
},
{
"source": "**",
"destination": "/index.html"
}]
}
]
}
如果我去mysite.com/articles/<articleID>
我mysite.com
会被带到我期望被带到的时候mysite.com/articles
。我做错了什么?
解决方案
采取以下步骤后,我能够解决问题:
- 将我的来源更改
/articles{,/**}
为/articles/**
- Change my destination from
articles
toarticles.html
which is a valid local file - Realize that changes to
firebase.json
don't change the behavior of the Firebase Hosting emulator until it is restarted.
推荐阅读
- c# - 使用新屏幕的控制台应用程序
- python - 线程处理时出现异步 aiohttp 错误
- javascript - Javascript addEventListener 回调逻辑
- javascript - 如何从 AWS API Gateway 获取 url 参数并将它们输入到 lambda
- python - 如何使用 Python 将整数转换为字典中的字符串?
- java - 加入两个表 Mysql Java 并将其作为列表发送到 jsp
- php - 403 Forbidden - 您没有访问权限
- javascript - HTML 表单 - 必填字段 - 了解必填字段是否已以编程方式完成
- ruby-on-rails - 我如何“期望”使用 Rspec 的方法链,其中第一个方法带有参数?
- python - 用于覆盆子 pi 的 python 中的 mp3 音乐循环