Skip to content

Instantly share code, notes, and snippets.

@adam-arold
Created January 6, 2018 14:59
Show Gist options
  • Save adam-arold/23aa700db7acf7247d5dd19b3c21dc93 to your computer and use it in GitHub Desktop.
Save adam-arold/23aa700db7acf7247d5dd19b3c21dc93 to your computer and use it in GitHub Desktop.
@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