This project shows RESTful routing in a form of a simple Blog app.
Prototype : https://still-reef-69131.herokuapp.com
Name | Path | HTTP Verb | Purpose | Mongoose Method |
---|---|---|---|---|
Index | /blogs | GET | List all blogs | blog.find() |
New | /blogs/new | GET | Show new blog form | N/A |
Create | /blogs | POST | Create a new blog, then redirect somewhere | blog.create() |
Show | /blogs/:id | GET | Show info about one specific blog | blog.findById() |
Edit | /blogs/:id/edit | GET | Show edit form for one blog | blog.findById() |
Update | /blogs/:id | PUT | Update particular blog, then redirect somewhere | blog.findByIdAndUpdate() |
Destroy | /blogs/:id | DELETE | Delete a particular blog, then redirect somewhere | blog.findByIdAndRemove() |