0.4.0 • Published 7 years ago

@canner/canner-functions v0.4.0

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

canner functions

array

const functions = require('@canner/canner-functions');

exports.validateOrder = functions.database.array('/orders').beforeCreate(({data, Errors}) => {
    return validate(data)
    .catch(err => throw Errors.forbidden());
})

object

const functions = require('@canner/canner-functions');

exports.updateTitle = functions.database.object('/brand/location').afterUpdate(({newData, database}) => {
    return database.object('/brand/title').set(`address: ${newData.address}`);
})

https

const functions = require('@canner/canner-functions');

exports.getPrice = functions.https.post('/price', ({req, res}) => {
    res.send("price");
})