Skip to content

Instantly share code, notes, and snippets.

@quentinchap
Created May 5, 2018 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quentinchap/38b820addae8c36d5c75590b48493ea8 to your computer and use it in GitHub Desktop.
Save quentinchap/38b820addae8c36d5c75590b48493ea8 to your computer and use it in GitHub Desktop.
package com.quentinchap.traductionmachine.hello
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
/* Cette annotation va entre autre permettre de convertir les réponses en JSON par défaut*/
@RestController
/* Définition du chemin permettant d'accéder aux apis de ce contrôleur*/
@RequestMapping("api/v1/hello")
class HelloController {
// On précise que cette méthode est accessible via la méthode get
@GetMapping
fun bonjour():String{
return "coucou"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment