Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 22, 2019 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/5c85b35e6e7a3e1c2c62488a658af1aa to your computer and use it in GitHub Desktop.
Save parzibyte/5c85b35e6e7a3e1c2c62488a658af1aa to your computer and use it in GitHub Desktop.
package HolaMundoSpringBoot;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class MascotasController {
@RequestMapping("/mascota")
public Mascota mascota(
@RequestParam(value="nombre", defaultValue="Sin nombre") String nombre,
@RequestParam(value="edad", defaultValue="0") int edad) {
return new Mascota(nombre, edad);
}
@RequestMapping("/")
public String inicio() {
return "Estamos en el índice /";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment