Skip to content

Instantly share code, notes, and snippets.

@daniele-zurico
Created June 12, 2018 18:27
Show Gist options
  • Select an option

  • Save daniele-zurico/77030b30c751bea38e47a1c7cbb0dacc to your computer and use it in GitHub Desktop.

Select an option

Save daniele-zurico/77030b30c751bea38e47a1c7cbb0dacc to your computer and use it in GitHub Desktop.
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