I am using express framework for my Node App. I need to have some real time updates like notifications in facebook. What I need is integrate derby.js(which is framework build on the top of express) only for real time notification triggering in express App. How can I accomplish this task?
Expressjs syntax I am using
app.get('/', function(req, res){
//other things as fetch query
res.render('index', { notificationcount : 0 });
});
Above thing will take notification count from database and displayed in view.
Derbyjs sample syntax for real time update
app.view.make('Body'
, 'Notications: <div>{notificationcount}</div>'
);
app.get('/', function (page, model) {
// Subscribe specifies the data to sync
model.subscribe('notificationcount', function () {
page.render();
});
});
What I need is only one section(box with notification count) from express rendered view page needs come from derby. So that the box will updated on real time updates on Database.
How we can integrate derby view in express? Is it possible?