java - SpringBoot:如何制作配置文件特定资源
问题描述
我有个人资料:dev,prod。
我的主页位于/src/main/resources/static/index.html
如何使用不同的个人资料制作不同的主页?
例如,/src/main/resources/static-dev/index.html
和/src/main/resources/static-prod/index.html
。
有什么建议吗?
解决方案
最后我得到了一个简单的解决方案。
使用不同的配置文件application.properties
和application-prod.properties
.
他们每个人都配置了不同的资源位置。例如spring.resources.static-locations=classpath:/static-dev/
.
推荐阅读
- sql - 如何使用 sql 获取每个月最畅销的产品?
- flutter - Flutter Web 中的 WebView
- angular - 如何使用角度创建获取请求
- c++ - 错误:函数声明符后的预期函数体
- python - 通过创建新列减少 Pandas 表中的行
- java - 如何将外部 .txt 文件中的文本与字符串进行比较
- tensorflow - ResourceExhaustedError:在 Keras 中分配张量时出现 OOM
- django - 未存储 Vue Nuxt Auth 登录令牌
- windows - MongoDB Atlas mongoimport 问题无法将数组解码为 D
- swift - MessageExtension 不会加载应用内购买