说明:开启自动编译以后,结合Ctrl+Shift+F9
会有热更新效果。 java
键入Ctrl + Shift + Alt + /
,进入Registry,找到compiler.automake.allow.when.app.running
,而后勾选上。 web
启动或者调试选择一个 json
@RestController //等价于 @Controller+@ResponseBody 用于返回json
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@RequestMapping("/helloWorld") //路由path
public String helloWorld() {
return "hello world!";
}
}
复制代码