简体   繁体   English

Firebase云功能-无部署错误,但未执行

[英]firebase cloud functions - no deployment error, but not executing

I recently started setting up firebase's cloud functions. 我最近开始设置Firebase的云功能。 I started with a simple helloWorld function 我从一个简单的helloWorld函数开始

const functions = require('firebase-functions');

const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);

exports.helloWorld = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
console.log("hello from firebase");
});

I have set up npm, node.js, python 3.65, pip installed, and the functions appear in the console. 我已经设置了npm,node.js,python 3.65,pip,并且功能出现在控制台中。 It just says "0 executions" and nothing happens. 它只说“ 0次执行”,什么也没有发生。 I didnt get any error message.. "Successful operation" and "deploy complete". 我没有收到任何错误消息。“成功操作”和“部署完成”。

Anyone got an idea why the function isnt being executed? 任何人都知道为什么不执行该功能?

As Frank said, deploying a function doesn't execute the function. 正如Frank所说,部署功能不会执行该功能。 When you deploy an HTTP function, you will receive a URL for that function. 部署HTTP函数时,您将收到该函数的URL。 The function runs when that url is accessed. 该函数在访问该URL时运行。 On first deployment, that url is printed to the console. 在第一次部署时,该URL将打印到控制台。 After that, you can see the full url by going to the Firebase console and finding your list of functions. 之后,您可以通过转到Firebase控制台并找到功能列表来查看完整的url。

Copy that url and paste it into your browser to see it work. 复制该网址并将其粘贴到浏览器中,以查看其工作原理。

You can also follow this guide to getting started with Cloud Functions for Firebase . 您还可以按照本指南开始使用Cloud Functions for Firebase

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM