Skip to content

Instantly share code, notes, and snippets.

@imarban
Last active November 10, 2015 18:39
Show Gist options
  • Save imarban/a1bb96e6b57506a1f0b6 to your computer and use it in GitHub Desktop.
Save imarban/a1bb96e6b57506a1f0b6 to your computer and use it in GitHub Desktop.
First Controller Spring Boot
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World !";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment