创建demo
java
package com.merchen.hello_world.controller;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/res")
public class ResController {
@GetMapping("/test/{value}")
public String testController(@PathVariable("value")String name){
return name;
}
}
shell
spring.application.name=hello_world
server.servlet.context-path=/hello
spring.thymeleaf.enabled=true
server.port=80 #例如生产是80,ip是localhost
配置远程端口

启动生产环境的jar包,命令

本地启动项目


访问本地(localhost:80相当于远程),即可断点调试