diff --git a/routes/api.js b/routes/api.js index 48deee3b..fff94582 100644 --- a/routes/api.js +++ b/routes/api.js @@ -22,6 +22,9 @@ var data = { exports.posts = function (req, res) { var posts = []; data.posts.forEach(function (post, i) { + if (typeof post.text == "undefined") { + post.text = "" + } posts.push({ id: i, title: post.title, @@ -75,4 +78,4 @@ exports.deletePost = function (req, res) { } else { res.json(false); } -}; \ No newline at end of file +};