💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# spring-boot 配置文件 #### application.yml *改端口:* ```yml server: port: 8004 ``` *多环境: (用`---`分割, 很方便)* ```yml spring: profiles: # 激活的环境 active: dev --- # 开发环境 spring: profiles: dev server: port: 8004 --- # 生产环境 spring: profiles: pro server: port: 8006 ``` #### application.properties *改端口:* ``` server.port=8080 spring.profiles=dev spring.thymeleaf.cache=false ``` *多环境:* 在Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式,其中{profile}对应你的环境标识,如 ``` application-dev.properties:开发环境 application-pro.properties:生产环境 ``` 直接在`application.properties`中启用 ``` spring.profiles.active=dev ``` *命令行选用配置:* ``` java -jar xxx.jar --spring.profiles.active=dev ```