Skip to content

Using Firebase functions to receive data in real time using Lightbug's push system (through HTTP POST)

License

Notifications You must be signed in to change notification settings

lightbug-io/firestore-receiver-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firebase HTTPS receiver for Lightbug API quickstart

Introduction

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

Initial setup, build tools and dependencies

1. Clone this repo

Clone or download this repo and navigate into the directory

2. Install the Firebase CLI and enable Functions on your Firebase CLI

You need to have installed the Firebase CLI. If you haven't run:

npm install -g firebase-tools

Login to firebase (if not already done) using

firebase login

3. Create a Firebase project and configure the quickstart

Create 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.

Deploy the app

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 deploy

This 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

View results

The example will create collections under /incoming - view data there

License

© Lightbug Ltd, 2020. Licensed under an MIT license.

About

Using Firebase functions to receive data in real time using Lightbug's push system (through HTTP POST)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published