Concept Flow - Middleware factory pattern
Call factory function with config
Factory returns middleware function
Express uses middleware in request flow
Middleware runs with access to config
Next middleware or response
The factory function creates a middleware configured by input, which Express then runs during requests.
