Springboot中如何设置不同的开发环境
2021-01-14 12:13
                         标签:访问   objects   world   request   stc   stat   oid   mic   return    通过不同的application-*.yml设置不同的开发环境 当我们需要哪个配置环境时,只需要在application.properties中指定即可,如下图所示:   如下测试: 在application.properties中指定的是application-sit.yml 所以访问地址为: http://localhost:8081/index      此时,我们把spring.profiles.active=test 这时候的访问地址为:http://localhost:8080/index   Springboot中如何设置不同的开发环境 标签:访问   objects   world   request   stc   stat   oid   mic   return    原文地址:https://www.cnblogs.com/weishao-lsv/p/12942025.html
@RestController
public class IndexController{
    @RequestMapping("/index")
    public String index() {
        return "hello world";
    }
}
@SpringBootApplication
public class DiffEnvAppilcation extends ApplicationObjectSupport {
    public static void main(String[] args) {
        SpringApplication.run(DiffEnvAppilcation.class, args);
    }
}


上一篇:python之tuple