log server errors in browser

added uid to posts
This commit is contained in:
Baris Soner Usakli
2013-04-30 12:40:16 -04:00
parent a6cbed94fc
commit 20aa5d439e
5 changed files with 30 additions and 6 deletions

View File

@@ -62,13 +62,15 @@ var RDB = require('./redis.js');
};
Posts.create = function(content, callback) {
if (global.uid === null) return;
Posts.create = function(uid, content, callback) {
console.log("global uid "+uid);
if (uid === null) return;
RDB.incr('global:next_post_id', function(pid) {
// Posts Info
RDB.set('pid:' + pid + ':content', content);
RDB.set('pid:' + pid + ':uid', global.uid);
RDB.set('pid:' + pid + ':uid', uid);
RDB.set('pid:' + pid + ':timestamp', new Date().getTime());
// User Details - move this out later