google-cloud-functions

Cloud Functions for Firebase - write to database when a new user created

主宰稳场 提交于 2020-04-09 08:06:31
问题 I am pretty new Cloud Functions for Firebase and the javascript language. I am trying to add a function every time a user created to write into the database. This is my code: const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(functions.config().firebase); exports.addAccount = functions.auth.user().onCreate(event => { const user = event.data; // The firebase user const id = user.uid; const displayName = user.displayName; const photoURL

Is there a way to stop/disable a Google Cloud Function?

☆樱花仙子☆ 提交于 2020-04-09 06:49:33
问题 I have running multiple Google Cloud functions. One is not operating well, so I want to stop them until I've fixed the situation. I have seen that I can remove the function, but is there a way to disable and later; enable the function? 回答1: You cannot disable a function. Just comment the function body. It would be a good practice to log the call in the console and then return null so you can keep track whenever the function is invoked. 回答2: I am not sure if this is late but what I did is that

Is there a way to stop/disable a Google Cloud Function?

允我心安 提交于 2020-04-09 06:45:30
问题 I have running multiple Google Cloud functions. One is not operating well, so I want to stop them until I've fixed the situation. I have seen that I can remove the function, but is there a way to disable and later; enable the function? 回答1: You cannot disable a function. Just comment the function body. It would be a good practice to log the call in the console and then return null so you can keep track whenever the function is invoked. 回答2: I am not sure if this is late but what I did is that

understanding “action required” email from GCP, re: enable Cloud Build API

a 夏天 提交于 2020-04-08 09:55:52
问题 I use Firebase for my web apps, not Google Cloud Platform -- though I'm aware that behind the scenes, every Firebase project is also a GCP project. I just received an email from GCP, saying (excerpted): [Action required]: Enable the Cloud Build API for your projects before April 20, 2020, to ensure Cloud Function is built and deployed correctly ... You must enable the Cloud Build API for your project(s) to ensure your Cloud Function is built and deployed correctly. Once you enable the API,

understanding “action required” email from GCP, re: enable Cloud Build API

。_饼干妹妹 提交于 2020-04-08 09:55:50
问题 I use Firebase for my web apps, not Google Cloud Platform -- though I'm aware that behind the scenes, every Firebase project is also a GCP project. I just received an email from GCP, saying (excerpted): [Action required]: Enable the Cloud Build API for your projects before April 20, 2020, to ensure Cloud Function is built and deployed correctly ... You must enable the Cloud Build API for your project(s) to ensure your Cloud Function is built and deployed correctly. Once you enable the API,

understanding “action required” email from GCP, re: enable Cloud Build API

你离开我真会死。 提交于 2020-04-08 09:55:27
问题 I use Firebase for my web apps, not Google Cloud Platform -- though I'm aware that behind the scenes, every Firebase project is also a GCP project. I just received an email from GCP, saying (excerpted): [Action required]: Enable the Cloud Build API for your projects before April 20, 2020, to ensure Cloud Function is built and deployed correctly ... You must enable the Cloud Build API for your project(s) to ensure your Cloud Function is built and deployed correctly. Once you enable the API,

Running a scheduler for each user in Firebase Cloud Functions?

左心房为你撑大大i 提交于 2020-04-06 04:14:19
问题 I wish to run a scheduler which runs according to each user in my cloud functions and not universal scheduler which runs at the same time for all users. For example, if a UserA performs a certain action the scheduler(eg. every 30 mins) is initiated for userA only and not other users. But then UserB also performs that same action and initiates the scheduler for himself at a different time. Now UserA’s and UserB’s scheduler could be running at different times but same intervals(30 mins) How can

403 Response from Google Cloud Functions

大憨熊 提交于 2020-04-05 06:09:29
问题 I'm receiving the following error when trying to execute a Cloud Function endpoint from the web: <!DOCTYPE html> <html lang=en> <meta charset=utf-8> <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"> <title>Error 403 (Forbidden)!!1</title> <style> *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www

error: unknown option '--inspect-functions' return when adding --inspect-functions to firebase emulators:start

假装没事ソ 提交于 2020-03-26 04:03:33
问题 I cant figure out why when I pass in the option --inspect-functions to firebase emulators:start I get an error saying error: unknown option '--inspect-functions' But when I run firebase emulators:start with any options the emulator runs perfectly, So I am bit stumped and would appreciate any help. This is my functions/package.json : { "name": "functions", "description": "Cloud Functions for Firebase", "scripts": { "lint": "eslint .", "serve": "firebase serve --only functions", "shell":

error: unknown option '--inspect-functions' return when adding --inspect-functions to firebase emulators:start

时光总嘲笑我的痴心妄想 提交于 2020-03-26 04:03:11
问题 I cant figure out why when I pass in the option --inspect-functions to firebase emulators:start I get an error saying error: unknown option '--inspect-functions' But when I run firebase emulators:start with any options the emulator runs perfectly, So I am bit stumped and would appreciate any help. This is my functions/package.json : { "name": "functions", "description": "Cloud Functions for Firebase", "scripts": { "lint": "eslint .", "serve": "firebase serve --only functions", "shell":