I'm using spring-rest
to create some @RestController
servlets. The application is not run on a webserver, but as a simple command line tool with embedded tomcat.
Most of them should be running on a public port, which is specified using server.port=80
property.
Question: how can I run different @RestController
on different ports? So that some of them are only accessibly internally?
@RestController
@RequestMapping("test")
public class TestServlet {
@RequestMapping(value = "/", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public String test() { return "OK"; }
}