Firebase API
Experimental API that creates a restful abstraction around a firebase
resource.
Install
npm install firebase-api --save
Usage
import firebaseAPI from 'firebase-api';
const users = firebaseAPI('my-firebase-app').resource('users');
users.post({first: 'Tyler', last: 'Durden'}).then(user => {
console.log(user);
});
users.get('-KEgqfTd8GnnSSO204ss').then(user => {
console.log(user);
});
users.all().then(data => {
console.log(data);
});
users.put({first: 'Cornelius', last: 'Durden', id: '-KEgqfTd8GnnSSO204ss'}).then(user => {
console.log(user);
});
users.delete('-KEgqfTd8GnnSSO204ss').then(resp => {
console.log(resp);
});