https://github.com/flocasts/serverless-offline-firebase
https://github.com/flocasts/serverless-offline-firebase
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/flocasts/serverless-offline-firebase
- Owner: flocasts
- Created: 2018-09-14T15:54:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T23:21:44.000Z (almost 3 years ago)
- Last Synced: 2025-02-27T23:35:54.716Z (over 1 year ago)
- Language: JavaScript
- Size: 867 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 43
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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),
}
```