Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created March 2, 2016 23:48
Show Gist options
  • Save brunokrebs/0857a7636ff625c49a48 to your computer and use it in GitHub Desktop.
Save brunokrebs/0857a7636ff625c49a48 to your computer and use it in GitHub Desktop.
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