google-cloud-functions

How to do Axios request from Firebase Cloud Function

你说的曾经没有我的故事 提交于 2020-12-29 03:42:31
问题 I've tried the following in Firebase Cloud Function to do an Axios request but it didn't work. const functions = require('firebase-functions'); const axios = require('axios'); const cors = require('cors')({ origin: true }); exports.checkIP = functions.https.onRequest((req, res) => { cors(req, res, () => { if( req.method !== "GET" ) { return res.status(401).json({ message: "Not allowed" }); } return axios.get('https://api.ipify.org?format=json') .then(data => { console.log(data) res.status(200

How to do Axios request from Firebase Cloud Function

谁说我不能喝 提交于 2020-12-29 03:42:26
问题 I've tried the following in Firebase Cloud Function to do an Axios request but it didn't work. const functions = require('firebase-functions'); const axios = require('axios'); const cors = require('cors')({ origin: true }); exports.checkIP = functions.https.onRequest((req, res) => { cors(req, res, () => { if( req.method !== "GET" ) { return res.status(401).json({ message: "Not allowed" }); } return axios.get('https://api.ipify.org?format=json') .then(data => { console.log(data) res.status(200

Get uid in firebase function onFinalize for firebase storage

人盡茶涼 提交于 2020-12-27 06:28:39
问题 I use the firebase JS sdk to upload audio files to firebase-storage. When this happens I need to process it based on the authenticated user doing the uploading (I upload it somewhere else for processing). This means I need to have access to the uid after it has been validated by storage rules, to keep it safe. While researching this I found workarounds such as using the metadata to send the user's ID token but in my opinion this is a bad idea as it's possible to abuse. I found this question

How can I rent and use my own servers for cloud functions? [closed]

a 夏天 提交于 2020-12-27 00:40:20
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago . Improve this question I want to use my own servers for cloud functions instead of relying on Google's to eliminate the cold start of functions, how can I do this? 回答1: firebaser here There is currently no native way to run your Cloud Functions on your own server. You can run the

How can I rent and use my own servers for cloud functions? [closed]

為{幸葍}努か 提交于 2020-12-27 00:36:05
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago . Improve this question I want to use my own servers for cloud functions instead of relying on Google's to eliminate the cold start of functions, how can I do this? 回答1: firebaser here There is currently no native way to run your Cloud Functions on your own server. You can run the

How can I rent and use my own servers for cloud functions? [closed]

落爺英雄遲暮 提交于 2020-12-27 00:34:28
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago . Improve this question I want to use my own servers for cloud functions instead of relying on Google's to eliminate the cold start of functions, how can I do this? 回答1: firebaser here There is currently no native way to run your Cloud Functions on your own server. You can run the

Is it possible to only accept function calls from my app in Firebase?

喜夏-厌秋 提交于 2020-12-20 23:18:17
问题 I am creating a game in Unity where the user can contribute with levels using a Level Creator system. My application is setup in a way that I just need to call the Cloud Function with the level info, and it handles duplicate entries and saves it to Firestore. All of this works perfectly. My question, basically, is: can I have my functions only accept calls from my game? (without having my users registered?). Naturally, I am using functions.https.onCall((data, context) => {}) . In the

will Cloud Function affect Firebase Storage bandwidth usage?

独自空忆成欢 提交于 2020-12-19 01:45:00
问题 I am trying to figure out why firebase storage usage is far above my expectation I only have few photo files in my Firebase storage, just around 75 photos, 100kb for each photo. but my bytes stored and object counts is way above my expectation as you can see in the image above. in this case, maybe I find the answer from the documentation in here When you deploy your function's source code to Cloud Functions, that source is stored in a Cloud Storage bucket. Cloud Build then automatically

will Cloud Function affect Firebase Storage bandwidth usage?

我与影子孤独终老i 提交于 2020-12-19 01:39:20
问题 I am trying to figure out why firebase storage usage is far above my expectation I only have few photo files in my Firebase storage, just around 75 photos, 100kb for each photo. but my bytes stored and object counts is way above my expectation as you can see in the image above. in this case, maybe I find the answer from the documentation in here When you deploy your function's source code to Cloud Functions, that source is stored in a Cloud Storage bucket. Cloud Build then automatically

How to delete outdated Firebase Cloud function containers from GC Storage?

本秂侑毒 提交于 2020-12-18 09:14:59
问题 So recently Firebase started charging for Cloud Functions container storage: https://firebase.google.com/pricing No free usage $0.026/GB I have deployed 2 functions several times (no more than 10 times, can't remember exact count, but this is still pretty low, IMO). Now I am already billed a small amount (fractions of a cent for now). So seems that if I deploy the functions another few dozens of times, I'll get close to a dollar, because old (and unused) containers are not deleted from the