+ bin, db, insagram, feed on main page
This commit is contained in:
1 parent
09412f288f
commit
0d6cf42c7f
18 files changed
+449
-17
No files matched your search
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Created by tmshv on 22/11/14.
|
||||
*/
|
||||
|
||||
var Router = require("express").Router;
|
||||
var Post = require("../schema/post");
|
||||
|
||||
module.exports = function (app) {
|
||||
var router;
|
||||
router = new Router();
|
||||
router.route("/api/feed")
|
||||
.get(function (req, res) {
|
||||
Post.find({}).exec(function (error, list) {
|
||||
if (error) return res.error(error);
|
||||
|
||||
res.json(list.map(function (post) {
|
||||
return post.toObject();
|
||||
}));
|
||||
});
|
||||
});
|
||||
app.use(router);
|
||||
};
|
||||
Reference in new issue
Block a user