Update wsp.js

This commit is contained in:
Mark Nadal 2016-09-26 22:50:35 -07:00 committed by GitHub
parent a0a5be519a
commit 347ac0ff37

View File

@ -147,13 +147,14 @@
}
tran.get = function(req, cb){
var body = req.body, lex = body['$'], reply = {headers: {'Content-Type': tran.json}}, opt;
gun.get(lex, function(err, node, key, at, ev){
gun.on('out', {gun: gun, get: lex, req: 1, '#': Gun.on.ask(function(at, ev){
ev.off();
var graph = at.put;
return cb({headers: reply.headers, body: {
'#': gun.wsp.msg(),
'@': body['#'],
'$': node,
'!': err
'$': graph,
'!': at.err
}});
return;
if(Gun.obj.empty(node)){
@ -180,7 +181,7 @@
}([]));
*/
cb({headers: reply.headers, chunk: node }); // Use this if you don't want streaming chunks feature.
}, opt);
})});
}
tran.put = function(req, cb){
//console.log("tran.put", req);
@ -225,4 +226,4 @@
wsp(opt.server);
}
});
}({}));
}({}));