`attachRoutes` should NOT be a middleware because it will force to register the routes once the first request comes in.