Spring Boot에서 외부 정적 경로 확보
1. 환경 – Spring Boot 버전 2.6.2(중요) 2. Spring Boot에서 외부 정적 경로를 설정하는 목적은… – 파일 업로드 기능을 추가하고 업로드된 위치의 이미지를 URL(예: http://localhost:8080/test.png)로 호출하고 싶은데 bootjar로 빌드할 때 기본 정적 경로는 /입니다. 그래서 내가 원하는 것을 할 수 없습니다. 세 번째 방법 application.properties 파일에 spring.web.resources.static-locations=file:E:/test/를 추가하기만 하면 됩니다. spring.web.resources.static-locations=file:E:/test/,classpath:/static/ 4. 주의사항 많은 블로그가 … Read more