5 Matching Annotations
- Jun 2020
-
proandroiddev.com proandroiddev.com
-
Cloud Functions working on the server or WriteBatches working on the client
-
-
indepth.dev indepth.dev
-
The section of code with exports.app = functions.https.onRequest(app); exposes your express application so that it can be accessed. If you don't have the exports section, your application won't start correctly
-
Firebase Functions enables you to use the ExpressJS library to host a Serverless API. Serverless is just a term for a system that runs without physical servers. This is a bit of a misnomer because it technically does run on a server, however, you’re letting the provider handle the hosting aspect
-
- Mar 2019
-
codewithhugo.com codewithhugo.com
-
const sinon = require('sinon'); const mockResponse = () => { const res = {}; res.status = sinon.stub().returns(res); res.json = sinon.stub().returns(res); return res; };
Incredibly helpful in conjunction with Chris Esplin's tutorials [0] and code [1] on TDD with Cloud Functions.
[0] https://howtofirebase.com/test-driven-cloud-functions-fea53c64110c
-
- Dec 2018
-
firebase.google.com firebase.google.com
-
To return data after an asynchronous operation, return a promise.
I just struggled for a few hours trying to resolve some errors about CORS and 500 INTERNAL errors.
This line is a bit misleading.
In trying to get things up and running, I was returning a simple JSON object rather than a Promise. According to what I found, even if you don't have any async work, you still need to return a Promise from your function.
-