Crea the middleware of the router