我正在构建spring-boot 2 App,想知道我是否可以以及如何为服务器文件添加静态资源位置,但是该应用所在的服务器与之不同。
我正在使用application.properties文件设置我的资源位置。对于磁盘中的文件来说这不是问题。
spring.resources.static-locations= file:/dir1/fileWithVideo/, file:/http://ip:port/home/seleco/video
它适用于磁盘文件,但不适用于服务器及其工作原理
答案 0 :(得分:0)
要动态获取服务器位置,请在application.properties中使用它。
spring.resources.static-locations=file:${app.config.dir:./directory location on server}/file name