I'm implementing a REST API in Kotlin, using two tutorials (1, 2).
The first one doesn't even include a main function to be the app's entry point.
The second, however, does include the following file, which isn't connected in any way (at least not one that I see) to the controller.
// ClientApiApplication.kt
@SpringBootApplication
class ClientApiApplication
fun main(args: Array<String>) {
runApplication<ClientApiApplication>(*args)
}
And this is the controller I'm using:
// GreetingController.kt
@RestController
class GreetingController {
@GetMapping("/greeting")
fun greeting() {
return "Hello World"
}
}
However, when I run ClientApiApplication it does recognise the controller.
So where is this binding taking place? Is this something that Spring does out of the box?