I have a Firebase project for my Flutter mobile app, and now I want to do a website with Angular. I don’t want to write again the same functions to request Firestore, so which are the solutions to have only one code for my backend ? Thank you
I have a Firebase project for my Flutter mobile app, and now I want to do a website with Angular. I don’t want to write again the same functions to request Firestore, so which are the solutions to have only one code for my backend ? Thank you
2
Answers
Write callable Firebase functions.
that way you can use the same code for multiple apps.
docs: https://firebase.google.com/docs/functions/callable
As an alternative to Firebase Functions you can host your own (e.g. nodejs) app and implement a simple web api (express) with the Firebase Admin SDK. When you don’t have a lot of traffic on your app Firebase Functions will have a cold start everytime you call that function which will result in a pretty long start up time of that function (can take 10+ seconds) and therefore your requests will be pretty slow if the called function isn’t up yet.