Made use of express middleware functionality