Skip to content

Instantly share code, notes, and snippets.

@grafjo
Created January 3, 2015 22:36
Show Gist options
  • Save grafjo/bf7637b90f48729b0714 to your computer and use it in GitHub Desktop.
Save grafjo/bf7637b90f48729b0714 to your computer and use it in GitHub Desktop.
package demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
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;
@SpringBootApplication
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@RequestMapping(value = "/{foo}", method = RequestMethod.GET)
public String hello(@PathVariable("foo") String foo) {
return "Hello World! foo is=" + foo;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment