Skip to content

boolean-uk/api-express-modular-routing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Modular Routing

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.

Learning Objectives

  • 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

Setup

  1. Fork this repository
  2. Clone the forked repository onto your local machines
  3. In the root directory, type npm install, which installs dependencies for the project
  4. Finally, type npm start, which starts a development server that will reload whenever you make any changes to source files

General Requirements / Instructions

  • 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

Standard Criteria

  • Implement the users, films and books 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

Extended Criteria

  • 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 and books APIs
  • Make sure all tests are passing -- you can run them yourself using npm run test-extensions

Releases

No releases published

Packages

No packages published