![](/img/trans.png)
[英]Firebase Functions Error - firebase.functions is not a function
[英]How do I do a GET for Firebase.functions().httpsCallable?
如何為Firebase.functions()。httpsCallable進行GET? 我一直收到POST錯誤404,但這是對服務器的GET請求。 我應該什么都不傳遞,還是可以更改此httpsCallable以獲得功能?
客戶
let updateWorkshop = Firebase.functions().httpsCallable('api/update/workshop');
updateWorkshop({/* nothing */})
.then(res => {
console.log(res);
}, err => {
console.log(err);
})
服務器
app.get('/v3/update/workshop', asyncMiddleware( async (req, res, next) => {
let results = await UPDATE_WORKSHOP_DATE.Run()
res.status(200).json({results: results})
}))
exports.api = FUNCTIONS.https.onRequest(app);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.