Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Latest commit

 

History

History
91 lines (63 loc) · 2.57 KB

README.md

File metadata and controls

91 lines (63 loc) · 2.57 KB

TAASPE Build Status

Trello As A Service Pre-Experiment

Need infinite storage space for free ? Let's exploit Trello !
Each board is an app, each list is a collection, each card is a document.

Install

npm install taaspe

Pre requirement

Authorize our trello application and create board taaspe TRELLO-API-KEY APP-NAME

Method list

var trelloback = taaspe.connect(‘board-id’)
trelloback.collections()                                                      //lists every collection
trelloback.collections(‘todos’)                               //create a collection ?
trelloback.collections(‘todos’).find()                    //retreive every document in collection
trelloback.collections(‘todos’).find(id: “docID”)            //retreive a specific document
trelloback.collections(‘todos’).create(object)               //create a document in collection
trelloback.collections(‘todos’).update(id: “docID”, object) //update a document in collection
trelloback.collections(‘todos’).delete(id: “docID”)           //delete a document in collection

API doc

taaspe

taaspe#connect(broadId)

broadId : the board Id on trello

Return: TrelloBack Instance

Example

TODO list REST API

app.get(/todos, function (req, res, err) {
var todos = trelloback.collections(‘todos’).find();
res.send(todos);
}))

app.post(/todos, function (req, res, err) {
    var todo_object = req.body;
    var todo = trelloback.collections(‘todos’).create(todo-object);
    res.send(todo);
}))

app.get(/todos/:id, function (req, res, err) {
    var requested_id = req.params.id;
    var todo = trelloback.collections(‘todos’).find({id: requested_id});
    res.send(todo);
}))

app.put(/todos/:id, function (req, res, err) {
    var requested_id = req.params.id;
    var todo_object = req.body;
    var todo = trelloback.collections(‘todos’).update({id:requested_id, todo_object});
    res.send(todo);
}))

app.delete(/todos/:id, function (req, res, err) {
    var requested_id = req.params.id;
    trelloback.collections(‘todos’).delete({id:requested_id});
    res.send(200);
}))

License

Copyright © One Does <[email protected]> 
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENCE file for more details.