Why do scientists get irritated when dealing with EMR: http://www.nejm.org/doi/full/10.1056/NEJMp1203102
API Economy. i.e. http://www.infoworld.com/article/2911639/apis/6-ways-to-get-a-grip-on-the-api-economy.html
API modeling languages: http://apievangelist.com/2014/01/16/api-design-do-you-swagger-blueprint-or-raml
Microservices: http://pivotal.io/platform/migrating-to-cloud-native-application-architectures-ebook
Class work:
[Jonas] Creating a web service with and API that operates the generation a vector with n random numbers:
Node server side
// jonas server at 8001
// service generating vector of random numbers
var http = require("http");
var port = 8001;
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "application/json"});
//response.write("Hello World from port "+port);
if(request.url!='/favicon.ico'){
console.log(request.url)
// parsing parameters out of URL
var pp={}
if(request.url.length>2){
request.url.match(/\?[^?]+/)[0].slice(1).split('&').forEach(function(p){
p=p.split('=')
pp[p[0]]=p[1]
})
}
if(!pp.n){pp.n=10}
console.log('parameters:',pp)
var Y={}
Y.rand=[]
for(var i=0;i<pp.n;i++){
Y.rand.push(Math.random())
}
response.end(JSON.stringify(Y));
}else{
response.end()
}
}).listen(port);
console.log('listening to port '+port+' here');