Files
Josh Long e1bdaa7851 cfdc
2015-05-14 19:31:01 -05:00

20 lines
557 B
Groovy

// to run on ur local machine this use:
// spring run hi-service.groovy
//
// to deploy this 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 + "!"]
}
}