package com.powernode.springboot.web;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class IndexController {
@RequestMapping(value="/say")
public @ResponseBody Object say(String message){
return "say : Hello "+message;
}
}
删除或者注释application.properties核心配置文件文件,创建application.yml核心配置文件,在里面写入端口号以及路径(如不写,空白,默认端口号为8080,无路径)
server:
port: 2022
servlet:
context-path: /
server:
port: 2022
servlet:
context-path: /yml