How to use firebase cloud functions
Issue #667
Use node 10
Edit package.json
1 | "engines": { |
Secret key
Go to settings/serviceaccounts/adminsdk
, download secret key in form of json
and place it in lib/config.json
1 | const serviceAccount = require('./config.json') |
Local serve
This builds and spins up emulator to test
1 | npm run serve |
CORS
- https://stackoverflow.com/questions/42755131/enabling-cors-in-cloud-functions-for-firebase
- https://mhaligowski.github.io/blog/2017/03/10/cors-in-cloud-functions.html
1 | response.set('Access-Control-Allow-Origin', '*'); |
1 | var cors = require('cors'); |
Updated at 2020-06-14 21:39:27