mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Update wsp.js
This commit is contained in:
parent
a0a5be519a
commit
347ac0ff37
11
lib/wsp.js
11
lib/wsp.js
@ -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);
|
||||
}
|
||||
});
|
||||
}({}));
|
||||
}({}));
|
||||
|
Loading…
x
Reference in New Issue
Block a user