Asynchronous https firebase functions

后端 未结 4 1015
一整个雨季
一整个雨季 2021-01-15 06:15

Should HTTPS functions return asynchronous promises like realtime functions have to? We haven\'t been returning in HTTPS functions (just using res.status.send etc), and it l

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-15 06:47

    This works now in the latest Firebase:

    exports.asyncFunction = functions.https.onRequest(async (request, response) => {
        const result = await someAsyncFunction();
        response.send(result);
    });
    

提交回复
热议问题