Learn
Learn Express Routes
Adding Animals Routes

Congratulations, you have made our glorious Express Yourself Machine fully operational! Not only that, you now have all the tools you need to create a basic CRUD API! Time to practice your skills with a new set of routes.

You are going to add an additional set of functionality to our machine: Animal Mode! This will involve creating similar GET, POST, PUT, and DELETE routes.

Instructions

1.

In your app.js file, Create a GET /animals route to return an array of all animals.

2.

Create a GET /animals/:id route to respond with a single animal.

3.

Create a PUT /animals/:id route to update an animal in animals and send back the updated animal.

4.

Create a POST /animals route to add new animals to the animals and respond with the new animal.

5.

Create a DELETE /animals/:id route to delete animals by ID.

Folder Icon

Sign up to start coding

Already have an account?