Hosting a REST API with a Cloud Firestore backend

Hosting a REST API with a Cloud Firestore backend



You can find the code here →

In the past, you’ve probably hosted different REST APIs on different backend servers such as Cloud SQL, Firebase, or App Engine. In this episode of Serverless Expeditions Extended, Martin Omander and Roger Martinez show you how to host a REST API on a Firestore backend. Watch as Roger and Martin guide you through initializing firestore, setting up the endpoints for your API, and much more!

Timestamps:
00:00 – Intro
00:59 – Firestore in Google Cloud Console
02:10 – Code: package.json
02:57 – Code: index.js
04:30 – Code: the app.get() function
06:10 – Deployment with Cloud Build and Cloud Run
07:04 – Cloud Build and Container Registry in Google Cloud Console
07:52 – Cloud Run in Google Cloud Console
08:34 – Demo 1
09:21 – Code: app.post() function
13:53 – Demo 2
15:37 – Troubleshooting!
17:37 – Demo 3

Checkout more episodes of Serverless Expeditions →
Subscribe to get all the episodes as they come out →

product: Cloud Firestore; fullname: Roger Martinez, Martin Omander;

#ServerlessExpeditions #ServerlessExpeditionsExtended

21 thoughts on “Hosting a REST API with a Cloud Firestore backend

  1. I couldn't help noticing the ~2.9 second POST request. Is this because of a cold start of the container or something?

  2. Great Video, exactly what I was looking for. However, how would you ensure the firestore cloud rules are being enforced if you are relying on the auth.id or a custom claim token? I don't see a way to access the firestore auth object in the google/firestore nodejs lib.

  3. Please can you do a video on cloud Functions. Runtime environments used in Cloud Functions and also the function framework. Thankyou this videos are awesome kudos to helping as learn.

  4. We can use firebase hosting for this sad, firebase hosting origin only available in USA zone 🙁 they don't even care to mention it in fb documents

  5. Great video. Thanks
    1) Is there a way to test locally and access to firestore? I guess firestore won’t run locally, but the troubleshooting feedback will be faster, and
    2) could you add Auth to the rest call? Like only for the POST request.

  6. I really don't understand why the old video describing this exact coding was removed. Are you also going to bring back the cloudrun video about converting Google sheets to API too ?

  7. Thx for this video. After this example we have multiple containers, do we need to pay for these old containers? Do we need to pay for unused service revisions?

Leave a Reply

Your email address will not be published. Required fields are marked *