@SpringBootApplication

@SpringBootApplication

  • @SpringBootApplication on main class as an entry point
@SpringBootApplication
public class SpringLearningApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringLearningApplication.class, args);
    }
}

@RestController
class MyController {

    @GetMapping("/")
    public String hello(){
        return "hello";
    }
}