我想知道确认PubSub消息(来自推送用户)的正确方式是什么,这是一个Firebase云函数。这是通过返回一个承诺来完成的吗? import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
export const listener = functions.pubsub.topic('new_members').onPublish(async (message:any) => {
let data = {
name:
我正在尝试从函数中实现一个firebase cron函数-cron示例
var functions = require('firebase-functions');
exports.hourly_job =
functions.pubsub.topic('hourly-tick').onPublish((event) => {
console.log("This job is ran every hour!")
});
我只想知道按照请求返回200响应的正确方式,因为我有错误日志。
函数返回未定义、预期的Promise或val
我正在为google云函数写一个测试,它会将一些信息写入到一个firestore数据库中。测试使用firebase-functions-test和jest。当我部署它时,我正在编写的函数可以成功工作,但是当我尝试运行测试时,我得到: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
at GrpcClient.loadProto (node_modules/google-gax/src/grpc.ts:182:23)
我有一个由Pub / Sub事件触发的云函数。它使用从用于数据的API发出多个GET请求。
在云函数仿真程序中本地运行时,它可以工作,但是在生产过程中,我一直收到这样的错误:
{ RequestError: Error: socket hang up
at new RequestError (/user_code/node_modules/request-promise/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/user_code/node_modu