Keys and values are limited to 250 ASCII characters,
excluding space, newline, ? and /
JSON-P is used for cross-domain communication
Optional second callback will be called on error
Rasta.get('some_key', function(val){
/* use val */
}, function(){
/* error occured */
})
Data store for static websites
Communication between front-ends
A building block
A simple, easy to implement API (just 2 endpoints):
GET /get/{key}?callback=?
and
GET /set/{key}/{val}?callback=?
Where's the data stored?
By default, my server (well, heroku at the moment). If you want to host your own, just change Rasta.url.
How much storage?
Unspecified by design. Let's say 5 MB. Old keys are invalidated. Strategy unspecified, could be LRU, LFU, etc.
Why HTTP GET for setting?
Because JSON-P doesn't support POST.
Message github.com/pitr for more questions
Wait. What's this again?
This is a key-value date store (something like Memcache or Redis)
that you can access from browser's front-end (like HTML5
localStorage), except you do not host it yourself.
By simply including provided script tag, you get a tiny library that
communicates with the data store. You get
Rasta.get(key, cb(), err()),
Rasta.set(key, val, cb(), err()), and
Rasta.url= (initialized to "http://rastajs.errorjs.com")