node-fakir
magic rest client
Description
You only deal with rest + json + callback-based apps? look no further:
How it works
Coffee
Fakir = require 'fakir' api = : "POST $msg TO http://foo.bar" : "GET http://foo.bar/stock/$ticker" # and call them! apihello "world" # all functions takes a "callback(err, data)" apiprice "PEAR" consolelog "PEAR: "
JS
Of course Coffee and JS interfaces are strictly the same, and share the same features:
var Fakir = ; var api = { return "POST $msg TO http://foo.bar"; } { return "GET http://foo.bar/stock/$ticker"; } true // add 'true' at the end to mock/debug the routes // chaining is supported, but not yet futures: functions are called immediately api
Changelog
0.0.1:
- moved routes into the Fakir constructor
- removed add() function
- fixed a closure bug with the for loop
- fixed a critical bug with optional callback
- added an optional mock parameter to test routes
- various cleaning