pho*_*ong 4 javascript firebase google-cloud-functions
如何对 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);
})
Run Code Online (Sandbox Code Playgroud)
服务器
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);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7731 次 |
| 最近记录: |