5 Matching Annotations
- Oct 2020
-
firebase.google.com firebase.google.com
-
Emulating TypeScript functions
YEah, but you've also got to watch the source files to recomp0ile on changes....
"serve": "tsc -w | firebase emulators:start --only functions",
Modified and functionally watching my stuff
-
- Jun 2020
-
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.
-