hoodie-server-task
CouchDB-based REST & front-end API for asynchronous background tasks
Scope
The goal is to create very simplistic server for static apps that can run background tasks that require back-end logic using a simple front-end API.
Install
npm install --save hoodie-server-task
Server API
Example usage with nodemailer to send emails from the front-end
var Hapi = var hapiTask = var options = couchdb: 'http://localhost:5984') var transporter = nodemailer server; server; serverstart { console;};
REST API
POST /api/queue/<id>/_bulk_docs
GET /api/queue/<id>/_changes
How it works
Tasks are json objects with special properties. hoodie-server-task
creates a
database (tasks
by default) where all task objects from all queues are
replicated to / from. Queues can only access their own tasks
(/api/queue/<id>/_changes
is a filtered changes feed by the given queue id).
Local setup & tests
git clone https://github.com/hoodiehq/hoodie-server-task.gitcd hoodie-server-tasknpm installnpm test