Created
March 2, 2016 23:48
-
-
Save brunokrebs/0857a7636ff625c49a48 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
package br.com.brunokrebs; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestMethod; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
@SpringBootApplication | |
public class AbtbvApplication { | |
class Message { | |
private String message; | |
public Message(String message) { | |
this.message = message; | |
} | |
public String getMessage() { | |
return message; | |
} | |
} | |
@RequestMapping(path = "/echo/{message}", method= RequestMethod.GET) | |
public Message echo(@PathVariable("message") String message) { | |
return new Message(message); | |
} | |
public static void main(String[] args) { | |
SpringApplication.run(AbtbvApplication.class, args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment