Node.js errors need some work.
Writing this in routes/api.js… exports.posts = function(req, res) { var posts = []; data.posts.forEach(function(posts, i) { posts.push({ id: i, title: post.title, text: post.text.substr(0, 50) + ‘…’ }); }); res.json({ posts: posts }); }; exports.posts = function(req, res) { var id = req.params.id; if (id >= 0 && id < data.posts.length) { res.json({ post: data.posts[id] }); } else { res.json(false); } }; [d'oh! Note the two `exports.posts`.] …and then attempting to run the Node server will through a less than helpful error: ...