4 import org.springframework.http.MediaType;
5 import org.springframework.web.bind.annotation.GetMapping;
6 import org.springframework.web.bind.annotation.RequestParam;
7 import reactor.core.publisher.Mono;
11 * Fetches and returns data from a remote-webserver.
14 @org.springframework.web.bind.annotation.RestController
15 public class RestController
17 RemoteContentService service;
20 public RestController(RemoteContentService service)
22 this.service = service;
26 @GetMapping(path = { "", "/" }, produces = MediaType.TEXT_PLAIN_VALUE)
27 public Mono<String> fetch(@RequestParam String path)
29 return service.getRemoteText(path);