Lecture 3
January 23, 2026
Topics
- PostgreSQL
- Prisma ORM
- TypeScript Introduction
Course Materials
Slides
- PDF (note-taking version): No builds or animations, for taking notes in class
- Full Slides: With builds and animations
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/:idfirst runsauthenticateUser, thenvalidateIdGET /api/papersfirst runsauthenticateUser, thenvalidateQueryParams
This illustrates how Express composes small middleware functions into a clear and structured request-handling pipeline.
Videos
Additional Resources
Last updated on