【发布时间】:2020-11-10 17:22:34
【问题描述】:
完整回购:https://github.com/jmsherry/firebase-full
firebase.json
{
"hosting": {
"predeploy": [
"npm --prefix webapp run build"
],
"public": "webapp/build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/server-time",
"function": "serverTime"
},
{
"source": "**",
"destination": "/index.html"
}
]
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
}
我正在尝试将我的功能与托管一起使用。该功能可用(网址:https://europe-west2-full-firebase-efc5a.cloudfunctions.net/serverTime),但服务器时间功能的重写在本地工作,但在托管它 404 的 Firebase 上运行并重定向到主页(网址:https://full-firebase-efc5a.firebaseapp.com/server-time)
好像它没有被发送到firebase端的函数!
谁能解释一下?
【问题讨论】:
标签: firebase google-cloud-functions firebase-hosting