jjzjj

Functions

全部标签

javascript - Parse.com 云代码 : Chaining functions?

我确信这是一个简单的函数,但我就是无法在Parse.com的CloudCode中使用链式函数。我知道这是可能的-所以这可能是对我的javascriptn00bness的控诉。;>下面是一个简单的测试函数链,展示了我认为它应该如何工作——但它没有。在response.error事件中,我似乎遇到错误,但在成功时我得到:{"code":141,"error":"success/errorwasnotcalled"}下面是测试函数:Parse.Cloud.define("initialFunction",function(request,response){varplayer=request

javascript - Cloud Functions for Firebase 组织

我知道有人问过这个问题here,但它没有回答我的问题。我的问题是我们如何为CloudFunctions分解index.js,包括onWrite调用等。我知道您可以使用“require”并引入外部代码。它仍然在index.js中留下一些代码(例如,在FranksOCR示例中)。理想情况下,我希望能够将整个onWrite事件触发器移动到另一个文件。index.js中的示例:exports.sysQueueUserNew=functions.database.ref("/sys/queue/user_new/{queueId}").onWrite((event)=>{//dosomethin

javascript - 如何从 '/functions' 以外的目录部署函数?

David在他的仓库中:https://github.com/davideast/react-ssr-firebase-hosting在主根目录中有带有firebase函数的文件index.js,不在/functions目录中。但是,如果我这样做并将我的index.js文件放到主根目录,如果我执行firebasedeploy--onlyfunctions它会在控制台中显示:ideployingfunctionsError:functions\index.jsdoesnotexist,can'tdeployFirebaseFunctions问:他怎么可能让它起作用?我怎样才能从/func

javascript - Firebase:错误解析触发器:找不到模块 'request-promise' 简单的云功能

想要为移动网站实现仅使用Firebase的方法,所以我决定为我的应用创建一个简单的API网关,这样我就可以调用云函数端点,而不是调用我的外部API并公开我的APIkey。我遵循了简单的helloworld示例并且没问题。一旦我按照Google示例(来自翻译和url缩短示例)中的说明添加了请求promise模块,我就无法继续。因为这个出现了。Errorparsingtriggers:Cannotfindmodule'request-promise'使用“请求”模块进行测试,结果相同。我的index.js真的很简单constfunctions=require('firebase-funct

javascript - Algolia 搜索网络错误

我正在将Algolia与我拥有的一个Firebase项目连接起来。我正在使用FirebaseCloudFunctions以使我的Algolia索引与我的Firebase数据库中发生的所有更改保持同步。但每当我打电话index.saveObject(firebaseObject);从我的FirebaseCloudFunctions中,我得到AlgoliaSearchNetworkError:getaddrinfoENOTFOUND5sffby8as8-1.algolianet.com5sffby8as8-1.algolianet.com:443我可以在FirebaseFunctions之

javascript - firebase-functions.js 调用 firebase.functions() 时出现内部错误

正如标题所说,当我调用firebase.functions()时,我在firebase-functions.js库中遇到内部错误。一些上下文,这是纯js,不是nodeJS、React或Jquery,我正在尝试调用httpsCallable云函数。云函数是可调用的,并且按照android的预期工作。firebase-functions.js库版本为4.13.0。错误是:Error​code:"internal"​columnNumber:2043​details:undefined​fileName:"http://www.gstatic.com/firebasejs/4.13.0/fi

javascript - 调试显示模块模式 : functions not in scope until called?

如果我在Chrome开发者工具中运行这段代码:vartest=(function(){varpublicFunction,privateFunction1,privateFunction2;privateFunction1=functionprivateFunction1(){returntrue;};privateFunction2=functionprivateFunction2(){returntrue;};publicFunction=functionpublicFunction(){privateFunction1();debugger;};return{publicFunc

javascript - 将带有参数的函数添加到 Array Javascript (Node.js)

我想将带有参数的函数推送到数组而不执行它们。到目前为止,这是我尝试过的:varload_helpers=require('../helpers/agentHelper/loadFunctions.js');varload_functions=[];load_functions.push(load_helpers.loadAgentListings(callback,agent_ids));load_functions.push(load_helpers.loadAgentCount(callback,agent_data));但是以这种方式,函数在推送时被执行。ThisQuestion

javascript - JS : How to track errors where there are many functions calls

每个函数都会创建新的错误对象。那么我怎样才能得到以前的错误呢?例如,这是我的代码:functionmain(callback){a(function(err){if(err){callback(newError('cannotrunmainfunction..'));return}})}functiona(callback){b(function(err){if(err){callback(newError('cannotrunbfunction'));return}})}functionb(callback){if(1==2)callback(newError('Errorinbfu

javascript - Azure Functions 执行速度极慢且不一致

我正在编写一些AzureFunctions脚本,用于从内部数据库读取和写入内部数据库,并将相关信息显示到网页中。我注意到在加载调用AzureFunction脚本的网页时,WebUI速度极慢甚至超时。经过进一步调查,我意识到以下几点:Azure函数脚本有时需要10秒到1分钟以上的时间才能连接到SQL数据库。有时脚本会在几毫秒内运行,有时需要3分钟以上才能完全运行脚本。这是我的Azure函数脚本:module.exports=function(context,req){context.log("FunctionStarted:"+newDate());//Importpackagecons