Objective: Use Node, Express, and MongoDB to build a full-stack microblog application.
- A server with RESTful API routes for blog posts. Your API should have the following five routes:
GET /api/posts
to READ all blog postsPOST /api/posts
to CREATE a new blog postGET /api/posts/:id
to READ one blog postPUT /api/posts/:id
to UPDATE one blog postDELETE /api/posts/:id
to DELETE one blog post
- Request specs for each of your API routes.
- A persistent database to store blog posts. Blog posts should at minimum have a
title
anddescription
. - A client that uses AJAX and Handlebars templating to
CREATE
,READ
,UPDATE
, andDELETE
blog posts. A user should be able to:- See a list of all blog posts
- Create a new blog post
- Update an existing blog post
- Delete an existing blog post
- A pleasing a logical user experience (take advantage of Bootstrap!)
- Prevent invalid data from being saved into the database, and handle errors in your API routes.
- Build a "likes" functionality that lets users "upvote" blog posts.
- Add a "category" attribute to your blog posts. When a user clicks on a category, take them to a page that displays all the blog posts that have that category.
- Fork this repo, and clone it into your
develop
folder on your local machine. npm init
to get started. You'll need to install the following node modules:
express
body-parser
hbs
mongoose
mocha
chai
request
- Use Postman to test and debug your API routes. Make sure you are always
console.log
-ing data that comes back from your API when you make an AJAX call before you write any other code.
- As you make code changes, frequently commit and push to GitHub.
- Once you've finished the assignment and pushed your work to GitHub, make a pull request from your fork to the original repo.