- fork and clone this repo
- npm install
- run
node seed.jsfrom the command line to setup your database (you'll need to havemongodrunning in the background) - to remove data from your database, run
mongofrom the command line, thenuse blog-api. rundb.posts.remove()to remove all posts, ordb.authors.remove()to remove all authors. You can always runnode seed.jsagain to re-seed the database - download Postman if you haven't already. It will be helpful for testing your api
Create an api with the following endpoints:
/api/postsget all blog posts/api/posts/:idget specific blog post (by id)/api/posts/sort/by-dateget all blog posts and order by dateapi/posts/sort/a-zget all blog posts sorted alphabetically by title/api/authorsget all authors/api/authors/sort/a-zget all authors sorted alphabetically/api/authors/:idget specific author (by id)/api/posts/tags/reactget all blog posts that have a 'react' tag/api/posts-with-authorsget all posts with author fully populated (in other words, the full author information should be displayed, including author name and id)/api/postsPOST a new blog post/api/posts/:idDELETE a blog post/api/posts/:idPUT (update) a blog post
- refactor your routes to use express router
- Create a 'tag search' field. add an index.html file with a text input box. When you type something into the input box and hit 'Submit', your API should search all your posts for any posts that have a tag that matches the input text