Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Sammy.js: NoSQL, No Problem

on

  • 7,590 views

Quick intro to Sammy + NoSQL

Quick intro to Sammy + NoSQL

Statistics

Views

Total Views
7,590
Views on SlideShare
7,550
Embed Views
40

Actions

Likes
8
Downloads
68
Comments
1

4 Embeds 40

http://www.slideshare.net 29
http://specificidea.com 5
http://poikkimaki.se 5
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Very interesting looking -- reminds of me of Nitrogen (erl) and Sinatra (rb) but in js. Could work real well with CouchDB, but CouchApp is another framework that implements a minimal CouchDB JS web app framework; it's just not signal routing the way frameworks like these are. Makes me a bit more partial to this and eager to play around with it.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Sammy.js: NoSQL, No Problem Sammy.js: NoSQL, No Problem Presentation Transcript

  • Sammy.js NOSQL, NO PROBLEM
  • Sammy.js Sammy is a simple Javascript framework built on top of jQuery.
  • Sammy.js RESTFUL EVENTED JAVASCRIPT
  • var app = $.sammy(function(app) { this.use(Sammy.Template); var db = loadDatabase(); this.get('#/', function(context) { this.pages = db.allDocs(function(docs) { context.docs = docs; context.partial('index.template'); }); }); Sammy.js this.get('#/page/:id', function(context) { this.page = db.getDoc(this.params.id, function(doc) { context.doc = doc; doc.partial('page.template'); }); }); this.post('#/page/:id', function(context) { db.saveDoc(this.params.id, this.params, function(doc) { context.doc = doc; context.partial('page.template'); }); }); });
  • Ye Olde Application Architecture Your $(hit) Javascript Framework (jQuery) Frontend Application (Ruby, PHP, Python, etc) Backend Database (SQL)
  • The NOW Your $(hit) JS Router/Controller (Sammy) Frontend DOM Framework (jQuery) Database Backend (NoSQL)
  • Sammy.js Sammy is a restful database’s best friend
  • #/ JSON HTML/JS Sammy.js JSON NoSQL
  • var app = $.sammy(function(app) { this.use(Sammy.Template); var db = loadDatabase(); this.get('#/', function(context) { this.pages = db.allDocs(function(docs) { context.docs = docs; context.partial('index.template'); }); }); Sammy.js this.get('#/page/:id', function(context) { this.page = db.getDoc(this.params.id, function(doc) { context.doc = doc; doc.partial('page.template'); }); }); this.post('#/page/:id', function(context) { db.saveDoc(this.params.id, this.params, function(doc) { context.doc = doc; context.redirect('#', 'page', doc.id); }); }); });
  • Sammy.js ‣ TINY ‣ TESTED ‣ WELL DOCUMENTED ‣ SIMPLE API ‣ EXTENSIBLE
  • Sammy.js