We give a method to construct Locally Recoverable Error-Correcting codes. This method is based on the use of rational maps between affine spaces. The recovery of erasures is carried out by Lagrangian interpolation in general and simply by one addition in some good cases.