Created
May 5, 2018 08:51
-
-
Save quentinchap/38b820addae8c36d5c75590b48493ea8 to your computer and use it in GitHub Desktop.
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 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