We've catalogued dinos, we've catalogued cryptids. We're making apps and taking names. Now it's time to take the names of some famous felines and preeminent puppers.
- Routes — Notes
- Using a Templating Language — Notes
- Controllers and Layouts — Notes
- POST/PUT/DELETE Routes — Notes
For this assignment, you're going to build an app that lists out famous cats and dogs. The context and extent of their fame is up to you—they can be real or fictional, domestically or familially famous—but a user will be able to log on and see a list of famous dogs or cats along with a picture and what they're famous for. You'll add data to the two JSON files provided.
You'll be doing pull requests to turn this in, so fork it to your Github account and clone it to your local machine.
Make an express app! This folder has nothing but a readme and some JSON files!
- Make an entry point
- NPM init
- Install dependencies
- Create your
.gitignore
and addnode_modules
andpackage-lock.json
to it - Set up your additional directories (views, static, routes/controllers)
You'll need all 7 RESTful routes for dogs and cats, stub out all 14 routes with a simple res.send
or console.log
for your non-GET routes. The seven routes are:
- Index
- Show/Details
- Add
- Create
- Edit
- Update
- Destroy
Hint: You will need to have two folders inside your views
directory, one for cats
and one for dogs
. Make sure to change your res.render()
statements accordingly!
Get data showing on the page first, then focus on your forms. Do they trigger the right console logs in your routes? Are they going to the right place?
Make your POST route first since it doesn't require middleware, then move onto PUT and DELETE.
Make it look less like raw HTML and more like the awesome app it is!
- Style it so each item on the index page is a card
- Have a default image if one isn't applied
- Create some failsaves for edge cases (i.e. what happens if someone sends an empty form?)