#Adding Behavior to Web APIs
Kevin Swiber
##Choose a Layer
{ | |
"class": "users", | |
"properties": { | |
"timestamp": 134197623137, | |
"duration": 76 | |
}, | |
"entities": [ | |
{ | |
"class": "user", | |
"rel": "http://usergrid.com/docs#user", |
var url = require('url'); | |
var webserver = require('./webserver'); | |
var routes = {}; | |
routes['/'] = { | |
get: function(request, response) { | |
var pathname = url.parse(request.url).pathname; | |
if (pathname !== '/') { |
#Adding Behavior to Web APIs
Kevin Swiber
##Choose a Layer
{ | |
"properties": { | |
"title": "Error on page load", | |
"description": "Steps to reproduce: ...", | |
"severity": 1, | |
"views": 6, | |
"version": 3 | |
}, | |
"entities": [ | |
{ |
ZSH=$HOME/.oh-my-zsh | |
plugins=(git node npm osx vi-mode) | |
source $ZSH/oh-my-zsh.sh | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
[[ -s "$HOME/nvm/nvm.sh" ]] && source "$HOME/nvm/nvm.sh" | |
# Use vi bindings in the terminal |
var pipeworks = require('pipeworks'); | |
var worker1 = pipeworks() | |
.fit(function(context, next) { | |
console.log('in worker 1'); | |
next(context); | |
}); | |
var worker2 = pipeworks() | |
.fit(function(context, next) { |
var pipeworks = require('pipeworks'); | |
var worker1 = pipeworks() | |
.fit(function(context, next) { | |
console.log('in worker 1'); | |
next(context); | |
}); | |
var worker2 = pipeworks() | |
.fit(function(context, next) { |
var pipeworks = require('pipeworks'); | |
var wip = 0; | |
var limit = 2; | |
var total = 0; | |
var check = function(context, next) { | |
if (wip === limit) { | |
console.log('I\'ll eat', context.food, 'later...'); | |
setTimeout(check.bind(this, context, next), 2000); |
exports = { say: function() { console.log('hello'); } }; |
// Add the following environment variables. | |
// Check the right directories are being set for | |
// the JDK at JAVA_HOME, the Android SDK at ANDROID_HOME. | |
// ANT_HOME can be found inside the ADT directory under | |
// eclipse/plugins. The directory starts with org.apache.ant. | |
JAVA_HOME="C:\Program Files (x86)\Java\jdk1.6.0_30" | |
ANDROID_HOME="C:\adt\sdk" | |
ANT_HOME="C:\adt\eclipse\plugins\org.apache.ant..." |