Provides a function to create middleware like pathway of functions to run before the endpoint function is run.