Last active
April 3, 2019 18:34
-
-
Save sescotti/f89a70be1a111721e579abc9a6a24042 to your computer and use it in GitHub Desktop.
HelloController.kt
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
package careers.debut.api | |
import org.springframework.web.bind.annotation.RequestMapping | |
import org.springframework.web.bind.annotation.RestController | |
import org.springframework.web.bind.annotation.PathVariable | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.http.ResponseEntity.ok | |
@RestController | |
@RequestMapping("/hello") | |
class HelloController { | |
@GetMapping("/{name}") | |
fun greet(@PathVariable("name") name: String) = ok(GreetDto("Hello $name!")) | |
data class GreetDto(val message: String) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment