我的意图是将https://example.com/admin
重定向到名为admin
的Firebase函数。所以我在firebase.json
中有以下代码:
{
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "/admin{,/**}",
"function": "admin"
},
{
"source": "**",
"destination": "/index.html"
}
]
}
}
我已经按照以下网站上的说明进行操作:https://firebase.google.com/docs/hosting/functions
使用我的浏览器,如果我转到https://my-server-my-project.cloudfunctions.net/admin
,一切正常。但是,如果我去https://example.com/admin
,这就是我得到的: