Spring boot URL로 access되지 않는 이미지 웹으로 전달하기
Spring bootimport org.springframework.core.io.Resource@RestController@RequestMapping("/images")public class ImageController { @GetMapping("/{imageName}") public ResponseEntity getImage(@PathVariable String imageName) throws IOException { Path imagePath = Paths.get("/path/to/your/private/images/" + imageName); Resource resource = new UrlResource(imagePath.toUri()); if (..
2024.12.05