方便的开始 Hello_SpringBoot的编写
刚开始按照之前的教程配置就行,虽然我还没写,哈哈
0x01 新建一个Hello
package com.Sky.o2o;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Hello {
@RequestMapping(name = "/hello", method = RequestMethod.GET)
public String hello() {
return "hello, you fucking guys springBoot";
}
}
0x02 注释
在pom.xml中将下面红框中的代码注释,因为等下使用Java Application的方式启动
0x03 配置application.properties
该文件是Springboot项目的配置文件 ,配置该文件下的项目运行的端口号和前缀:
server.port=8080
#加入/o2o前缀
server.context-path=/o2o