Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I run Firebase Storage cloud functions locally?

From Firebase DOCS:

Run functions locally

The Firebase CLI includes a Cloud Functions emulator which can emulate the following function types:

  • HTTPS functions
  • Callable functions
  • Cloud Firestore functions

You can run functions locally to test them before deploying to production.

QUESTION

Is there a way to run cloud functions for Firebase Storage (ex: triggered by file upload) locally or do I need to actually deploy them for testing?

like image 952
cbdeveloper Avatar asked Jun 28 '19 08:06

cbdeveloper


People also ask

Can I run cloud function locally?

You can run functions locally using either Function Frameworks or Cloud Native buildpacks. Function Frameworks are open-source libraries used within Cloud Functions to unmarshal incoming HTTP requests into language-specific function invocations.

Can Firebase be used locally?

The Firebase Local Emulator Suite is a set of advanced tools for developers looking to build and test apps locally using Cloud Firestore, Realtime Database, Cloud Storage for Firebase, Authentication, Firebase Hosting, Cloud Functions (beta), Pub/Sub (beta), and Firebase Extensions (beta).


2 Answers

firebaser here

Update: the Firebase Emulator Suite now also supports Cloud Storage. This includes uploads to emulated Cloud Storage triggering emulated Cloud Functions.

See the documentation for full details.

like image 191
Frank van Puffelen Avatar answered Oct 23 '22 19:10

Frank van Puffelen


Storage has been implemented in firebase tools 9.11.0. I just took it for a test run, and I found that functions running in the emulator are, indeed, triggered by uploads to the emulated storage.

https://github.com/firebase/firebase-tools/issues/1738#issuecomment-843256335

like image 4
SHeyl Avatar answered Oct 23 '22 18:10

SHeyl