server: port: 9000 zuul: routes: source: url: http://localhost:8080
@SpringBootApplication @EnableZuulProxy public class RouterApp { public static void main(String[] args) { SpringApplication.run(RouterApp.class, args); } }
@SpringBootApplication @RestController public class SourceApp { public static void main(String[] args) { SpringApplication.run(SourceApp.class, args); } @RequestMapping(value = "/hello/{name}", method = RequestMethod.GET) public String hello(@PathVariable String name) { return "hello, " + name; } }
http://localhost:9000/source/hello/dd