Skip to content

flocasts/serverless-offline-firebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless Offline Firesbase Server

A basic plugin to run a firebase server with serverless offline.

Install

npm install serverless-offline-firebase

Basic Usage

serverless.yml

...
plugins:
    - serverless-offline-firebase
    - serverless-offline

custom:
  firebase:
    host: localhost
    port: 5000

functions:
  set-data:
    handler: handler.setData
    events:
      - http:
          path: set-data/{key}
          method: post
...

handler.js

const Firebase = require('firebase');

class FirebaseExample {
    constructor() {
        this.app = null;
        this.db = null;
        this.databaseUrl = `ws://localhost:5000`;
    }

    setData(event, context) {
        ...
    }
}

const fe = new FirebaseExample();

module.exports = {
    setData: fe.setData.bind(fe),
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published