Created
June 12, 2018 18:27
-
-
Save daniele-zurico/77030b30c751bea38e47a1c7cbb0dacc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Post } from "../models/posts"; | |
| const postController = { | |
| posts: () => Post.find({}), | |
| addPost: (post: any) => { | |
| const newPost = new Post({author: post.author, comment: post.comment}); | |
| return newPost.save(); | |
| } | |
| }; | |
| export { postController }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment