Hosting と同じドメインで Cloud Functions の関数を呼び出す
"hosting": {
"rewrites": [
{
"source": "/notifications",
"function": "notifications"
},
{
"source": "**",
"destination": "/index.html"
}
]
Hosting の設定ファイルで rewrites の設定をすれば OK
https://firebase.google.com/docs/hosting/url-redirects-rewrites?hl=ja#section-rewrites
firebase.json
exports.notifications = functions
.https
.onRequest((req, res) => {
// ...
};
functions/index.js