Q. In Express.js, how is middleware typically defined and used in the application pipeline?