Middleware for routing requests to application logic.