Middleware can be used for both generic Express route configurations and in very specific use cases. The general pattern of middleware transformations in Express is always consistent, so your main concern is the scope and order of when middleware should be used. Let's explore how to create custom Express middleware that we will use only on specific route contexts.