hoodie-plugin-public-share
Installation:
hoodie install public-share
Usage:
Assuming you have a running hoodie setup.
Create a few documents you'd like to make publicly available:
var docs = [
{
name: 'sleep'
},
{
name: 'eat'
},
{
name: 'sleep some more'
}
];
hoodie.store.add('tasks', docs).done(function(newDocs) { /.../ });
Make all 'tasks' publicly available:
hoodie.store.findAll('tasks').publish();
or publish a single task:
hoodie.store.find('tasks', 'taskID12345').publish();
Same goes for unpublishing:
hoodie.store.findAll('tasks').unpublish();
hoodie.store.find('tasks', 'taskID12345').unpublish();
Accessing publicly shared files:
hoodie.public.findAll('tasks').done(function (docs) {
console.log(docs);
});
Testing:
grunt