re: Beginner's Guide for Creating a Serverless REST API using NodeJS over Google Cloud Functions VIEW POST


I have a dumb question :p
Why we have to build an api for firebase database and not directly use the firebase api to access our firestore database?


This is a simple tutorial, I tried to keep our endpoints simpler as possible but most cases you need to have authentication, you need to do extra processes before inserting a record, you need to create an extra task, handle permissions, roles, etc. This is a backend service, it isn’t about just accessing database.

If you have any other question, feel free to ask :)


i have a url-shortener without users logging in. I cannot write to firestore from the Vue client because the firestore rules need a user logged in. I can also not use the firebase-admin because the code runs on the client. So, now i am trying a cloud function as an API relay.


But you can authenticate using an anonymous login(it is available on firebase), so, you can login user using token generates from the client without having username or password.

HI Levi, Thanks for the tip, i will look into that!

Code of Conduct Report abuse