Created
November 12, 2018 23:56
-
-
Save Joxebus/68e9b844681eba310e2a28715b5f47e1 to your computer and use it in GitHub Desktop.
Example controller with parameters in groovy for Spring Boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app.groovy | |
@RestController | |
class ThisIsAnExample { | |
@RequestMapping('/{name}') | |
String sayHello(@RequestParam(value = "name", | |
required = false) String name){ | |
"Hello ${name ?: 'World'} from Spring Boot + Groovy" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment