Instruction: Describe middleware's role in Node.js applications outside the context of Express.js.
Context: This question tests the candidate's understanding of the middleware pattern as a generic concept in Node.js applications, not limited to Express.js.