Skip to content
skillbld
Node.js · 14-day planAll days
Day 11 of 14 35 min

Build a tiny web framework to understand middleware, the idea behind Express, Fastify and Koa. Chain functions with next(), add logging, JSON parsing, authentication and error handling as middleware, then see the same app written in Express.

By the end of today you can

  • Explain what middleware is and how next() passes control
  • Write logging, body-parsing and authentication middleware
  • Handle errors in one place with error-handling middleware
  • Split routes into routers
  • Read and write a basic Express app

What's inside

  • 3 sections
  • 2 diagrams and mind maps
  • 2 code examples you can run
  • 5-question quiz
  1. 1The middleware chain
  2. 2Useful middleware
  3. 3The same app in Express

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free

Keep going

Day 11: Middleware & Express · Node.js · SkillBld