React server side rendering of home page

This commit is contained in:
Jonathan Cremin 2014-12-14 00:23:15 +00:00
parent 4bfdf0dc45
commit 08e0aa7665
5 changed files with 210 additions and 8 deletions

View file

@ -35,7 +35,8 @@ module.exports = function(req, res, next) {
services[id].lookupId(result.id, result.type).then(function(item) {
items[id] = item;
req.db.matches.save({_id:id + "$$" + result.id, created_at: new Date(), services:items}).then(function() {
res.redirect("/" + id + "/" + result.type + "/" + result.id);
res.json(item);
//res.redirect("/" + id + "/" + result.type + "/" + result.id);
});
});
}