Skip to content

Instantly share code, notes, and snippets.

View Joxebus's full-sized avatar
:octocat:
Working from home

Omar Bautista Joxebus

:octocat:
Working from home
View GitHub Profile
@Joxebus
Joxebus / ThisIsAnExample.groovy
Created November 12, 2018 23:56
Example controller with parameters in groovy for Spring Boot
// app.groovy
@RestController
class ThisIsAnExample {
@RequestMapping('/{name}')
String sayHello(@RequestParam(value = "name",
required = false) String name){
"Hello ${name ?: 'World'} from Spring Boot + Groovy"
}
}
@Joxebus
Joxebus / ThisIsAnExample.groovy
Created November 12, 2018 23:54
Example controller groovy for Spring Boot
// app.groovy
@RestController
class ThisIsAnExample {
@RequestMapping('/')
String sayHello(){
"Hello World from Spring Boot + Groovy"
}
}
def sayHello = { name ->
println "Hello $name"
}
sayHello("Omar")