$ createdb catstravaganza
(first time setup only; assumes you have PostgreSQL and its CLI tool installed)$ npm install
$ npm start
- You'll need to use the post route a few times or just add info directly in Postico because there is no seed file. But you're here to learn about routes anyway, so I don't feel bad about making you do that.
- I highly recommend downloading the Postman tool for testing routes
- You can use Postman to send all types of requests to your localhost and see the responses
There's a review video featuring this repo here!
-
See if you can use the methods given to you by the "Owner has many cats" relation!
- Create an owner instance method called
adopt
that is passed the id of a cat and then associates that cat with its new owner! (Have the owner adopt a random cat if no id is passed in, but not one that already has an owner!) - Then make a PUT route in the owner routes that will allow an owner to adopt a cat!
- You can see a solution to this in the
adoption-solution
branch, which is discussed in this video!
- Create an owner instance method called
-
Play around and see what other methods and routes you can come up with!