Upload
fokke-zandbergen
View
581
Download
0
Embed Size (px)
Citation preview
28 maart 2014 go.fokkezb.nl/apistrat14
Full-stack JavaScript App Development
API.
28 maart 2014 go.fokkezb.nl/apistrat14
Full-stack JavaScript App Development
.IPA
database
server-side mvc
client-side mvc
i/o
alert('hello'); require('http').createServer();
database
run-time v + i/o
run-time mc
tooling
• Backbone.js • Underscore.js • CommonJS • Node.js packages
.IPA
DEV-TIME RUN-TIME
• Node.js • npm install -g ti
building
• Node.js • MongoDB
Express ● Angular ●
API.JSON
back-end
automating
Mocha ● Should ●
• Grunt • Yeoman
testing
WHY JS APP & API ?
• One language, one expertise• Shared tooling between APP & API
• Shared library between APP & API• Move code between APP and API
EFFICIENCY ● PORTABILITY
var sel = db.col.find();!response.write(JSON.stringify(sel));
API
APPvar models = col.fetch();!_.each(models, function(model) {! model.analysis = require('analysis').off(model);!});
JSON
var sel = db.col.find();!_.each(sel, function(model) {! model.analysis = require('analysis').off(doc);!});!response.write(JSON.stringify(sel));
API
APPvar models = col.fetch();
JSON
APP
PUBLIC API PUBLIC API PUBLIC API
APP
PUBLIC API PUBLIC API PUBLIC API
MIDDLEWARE
TOKEN
[email protected] @FokkeZB go.FokkeZB.nl/apistrat14