Created
January 6, 2018 14:59
-
-
Save adam-arold/23aa700db7acf7247d5dd19b3c21dc93 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@SpringBootApplication | |
class Application | |
fun main(args: Array<String>) { | |
SpringApplication.run(Application::class.java, *args) | |
} | |
data class Greeting(val id: Long, val content: String) | |
@RestController | |
class GreetingController { | |
val counter = AtomicLong() | |
@GetMapping("/greeting") | |
fun greeting(@RequestParam(value = "name", defaultValue = "World") name: String) = | |
Greeting(counter.incrementAndGet(), "Hello, $name") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment