【发布时间】:2017-11-10 16:10:00
【问题描述】:
看起来 Cloud Functions 不支持 Async-Await 表示法。有没有办法在他们使用 Babel 之前使用它们,或者是否建议使用 Promise?
我当前在 Node 上的函数是这样的:
exports.getToken = async (req, res) => {
//1. Generate token from Braintree
const result = await gateway.clientToken.generate();
//2. Return the client token
res.json(result.clientToken);
};
【问题讨论】:
标签: firebase google-cloud-functions