Chapter quiz · Middleware Mastery

Test what you learned.

8 questions on Middleware Mastery. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

Middleware — Chapter Quiz

Eight questions on the onion/cascade model, await next(), middleware order, error handling, koa-compose, koa-mount, and third-party mounting.

0/ 9
  1. Question 1
    1

    Describe Koa's middleware execution model.

  2. Question 2
    2

    What happens if a Koa middleware never calls await next()?

  3. Question 3
    3

    Where should a top-level error-handling middleware be placed relative to other middleware?

  4. Question 4
    4

    What does koa-compose do?

  5. Question 5
    5

    Given three middleware A, B, C registered in that order, each calling await next(), and each logging before and after next(): what is the log order?

  6. Question 6
    6

    koa-mount lets you mount a Koa sub-app or middleware at a specific URL path prefix.

  7. Question 7
    7

    In Koa error-handling middleware, call ctx.___ = err.status || 500 to forward the HTTP status from a thrown error.

  8. Question 8
    8

    Which are correct ways to reuse a set of middleware across multiple Koa apps?

    Select all that apply.

Pick an answer — instant feedback as you go.