Skip to Content
LecturesLecture 3

Lecture 3

January 23, 2026

Topics

  • PostgreSQL
  • Prisma ORM
  • TypeScript Introduction

Course Materials

Slides

Note: Slides 22–23

Slides 22–23 were newly added based on a great question raised in class: “Can we attach multiple middleware functions to a router?”

The answer is yes. Express allows you to attach multiple middleware functions, and they are executed in order from left to right.

In addition, Slide 23 demonstrates another common and powerful usage of express.Router(): middleware attached using router.use() applies to every route in that router.

In the example shown:

  • GET /api/papers/:id first runs authenticateUser, then validateId
  • GET /api/papers first runs authenticateUser, then validateQueryParams

This illustrates how Express composes small middleware functions into a clear and structured request-handling pipeline.

Videos

Additional Resources

Last updated on