首页 > 解决方案 > SpringBoot:如何制作配置文件特定资源

问题描述

我有个人资料:dev,prod。

我的主页位于/src/main/resources/static/index.html

如何使用不同的个人资料制作不同的主页?

例如,/src/main/resources/static-dev/index.html/src/main/resources/static-prod/index.html

有什么建议吗?

标签: javaspring-boot

解决方案


最后我得到了一个简单的解决方案。

使用不同的配置文件application.propertiesapplication-prod.properties.

他们每个人都配置了不同的资源位置。例如spring.resources.static-locations=classpath:/static-dev/.


推荐阅读