Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tstreamdoth/firebase-swiss
The Firebase Swissknife 🇨ðŸ‡
https://github.com/tstreamdoth/firebase-swiss
cloud-functions firebase firebase-database firebase-functions serverless
Last synced: 12 days ago
JSON representation
The Firebase Swissknife 🇨ðŸ‡
- Host: GitHub
- URL: https://github.com/tstreamdoth/firebase-swiss
- Owner: tstreamDOTh
- License: mit
- Created: 2019-06-06T11:33:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:59:33.000Z (almost 2 years ago)
- Last Synced: 2024-10-27T15:31:07.571Z (18 days ago)
- Topics: cloud-functions, firebase, firebase-database, firebase-functions, serverless
- Language: JavaScript
- Homepage:
- Size: 871 KB
- Stars: 12
- Watchers: 1
- Forks: 7
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# firebase-swiss
[![Build Status](https://circleci.com/gh/LogRocket/redux-logger/tree/master.svg?style=svg)](https://circleci.com/gh/tstreamDOTh/firebase-swiss/tree/master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![node](https://img.shields.io/badge/node-10.16.x-brightgreen.svg)](https://github.com/tstreamDOTh/firebase-swiss) [![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg)](#contributors)
## Table of contents
- [Install](#install)
- [Usage](#usage)
- [Recipes (Coming Soon)](#recipes)
- [Options (Coming Soon) ](#options)## Install
Using Yarn
`yarn add firebase-swiss`
Using NPM
`npm i firebase-swiss`
## Usage
If you are totally new to Firebase or Firebase Cloud Functions then [get started here](https://firebase.google.com/docs/functions/get-started)
Once you have created your firebase projects and setup cloud functions, you can start creating your CRUD api's like the following by using simple configuration -
```javascript
// functions.js
const FireFunctions = require('firebase-swiss');
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const cors = require('cors')({
origin: true
});admin.initializeApp(functions.config().firebase);
const firefunctions = new FireFunctions(admin.database());
exports.addApplicant = firefunctions.getFireFunction({
type: 'CREATE',
ref: 'applicants',
extractFromBody: ['name', 'role'],
enableCors: true
});exports.getApplicantById = firefunctions.getFireFunction({
type: 'READ',
ref: 'applicants',
enableCors: true
});exports.updateApplicantById = firefunctions.getFireFunction({
type: 'UPDATE',
ref: 'applicants',
extractFromBody: ['name', 'role'],
enableCors: true
});exports.deleteApplicantById = firefunctions.getFireFunction({
type: 'DELETE',
ref: 'applicants',
enableCors: true
});```
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
T Thiyagaraj
💻
Alejandro Baeza
📖
Kaspar Arme
📖
Dmitry Savchenkov
📖
Bos Eriko Reyes
📖
Cory Cunningham
💻
vAporInside
📖
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!