Pass middleware to server