The function lbListener is created to receive HTTP POST messages from LB API.
The URL of this function would be something like https://us-central1-AAAA-BBBBB.cloudfunctions.net/lbListener
This URL should be used as the endpoint for an API Push in the Lightbug Cloud.
Further reading
Clone or download this repo and navigate into the directory
You need to have installed the Firebase CLI. If you haven't run:
npm install -g firebase-toolsLogin to firebase (if not already done) using
firebase loginCreate a Firebase Project on the Firebase Console.
Set up your Firebase project by running firebase use --add, select your Project ID and follow the instructions.
First you need to install the npm dependencies of the functions:
cd functions
npm install
cd ..And deploy to Firebase using the following command:
firebase deployThis deploys and activates the lbListener Function.
Note: The first time you call firebase deploy on a new project with functions, it will take longer than usual
The example will create collections under /incoming - view data there
© Lightbug Ltd, 2020. Licensed under an MIT license.