📜  firebase 函数配置 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:52.488000             🧑  作者: Mango

代码示例2
const functions = require('firebase-functions');const request = require('request-promise');exports.userCreated = functions.database.ref('/users/{id}').onWrite(event => {  let email = event.data.child('email').val();  return request({    url: 'https://someservice.com/api/some/call',    headers: {      'X-Client-ID': functions.config().someservice.id,      'Authorization': `Bearer ${functions.config().someservice.key}`    },    body: {email: email}  });});