In this exercise, you are going to extend the REST APIs you have been building to handle DELETE and PUT requests. You will also learn how to make your route handling more modular in express using express.Router.
- Use Express.Router to encapsulate routing behavior for different resources
- Explain and build a CRUD RESTful JSON API including PUT and DELETE
- Build an API to satisfy a specification
- Fork this repository
- Clone the forked repository onto your local machines
- In the root directory, type
npm install
, which installs dependencies for the project - Finally, type
npm start
, which starts a development server that will reload whenever you make any changes to source files
- For this exercise, you must follow a "modular routing" approach using the express.Router class -- read the official documentation here
- Use the global variables exported from
/data/index.js
as your data stores
- Implement the
users
,films
andbooks
endpoints for this API according to the API spec - You should IGNORE error handling, this is only required for the extension
- Make sure all tests are passing -- you can run them yourself using
npm run test
- Implement the
EXTENSION
criteria as highlighted in the API spec- You need to implement error handling for all existing endpoints
- There are also a few new endpoints for the
films
andbooks
APIs
- Make sure all tests are passing -- you can run them yourself using
npm run test-extensions