Added ability to have auto routing and middleware when using autoRouting