Files
spring-cloud-cloudfoundry/spring-cloud-cloudfoundry-sample/hi-service.groovy
Marcin Grzejszczak 004e83b1e8 Added checkstyle
2019-02-05 15:21:41 +01:00

21 lines
524 B
Groovy

// to run locally use:
// spring run hi-service.groovy
//
// to deploy to Cloud Foundry use:
// spring jar hi.jar hi-service.groovy
// cf push hi-service -p hi.jar
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
@RestController
class GreetingRestController {
@RequestMapping("/hi/{name}")
def hi(@PathVariable String name) {
[greeting: "Hello, " + name + "!"]
}
}