merged major improvements and deployed to heroku

This commit is contained in:
Mark Nadal 2015-01-22 05:45:16 -07:00
parent 42d90ba22c
commit 96bbb102f0
2 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,7 @@
"description": "Example gun apps"
, "version": "0.0.1"
, "engines": {
"node": "~>0.8.x"
"node": "~>0.10.x"
}
, "dependencies": {
"express": "~>4.9.0",

View File

@ -129,6 +129,7 @@
reply.loaded = true;
}));
// could there be a timing error somewhere in here?
var setImmediate = setImmediate || setTimeout; // TODO: BUG: This should be cleaned up, but I want Heroku to work.
setImmediate(function(){ // do not do it right away because gun.load above is async, this should be cleaner.
var context = gun.union(req.body, function check(err, ctx){ // check if the body is valid, and get it into cache immediately.
context = ctx || context;
@ -140,7 +141,7 @@
cb({headers: reply.headers, body: {ok: "Persisted."}});
});
});
});
}, 0);
gun.server.on('network').emit(req);
}
tran.post.key = function(req, cb){ // key hook!