开发框架 springBoot

Posted 点点_滴滴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了开发框架 springBoot相关的知识,希望对你有一定的参考价值。

1.多个环境的配置文件

在application.yml 中配置需要调用的配置文件

spring:
  profiles:
    active: dev

运行方式的,先运行application.yml 再根据active指定的配置文件,进行覆盖。

linux中启动程序指定配置文件

java -jar springbootdemo.jar -- spring.profiles.active=dev

2.运行状态监控Actuator

pom中引入依赖

<!--运行状态监控-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

在application.yml文件中配置

management:
  endpoints:
    web:
      exposure:
        include: "*"
  server:
    port: 10111
    servlet:
      context-path: /
    ssl:
      enabled: false
  endpoint:
    health:
      show-details: always

访问方式:http://localhost:10111/actuator/health

访问结果:

{"status":"UP","details":{"db":{"status":"UP","details":{"database":"mysql","hello":1}},"diskSpace":{"status":"UP","details":{"total":463330078720,"free":113779286016,"threshold":10485760}}}}

 

以上是关于开发框架 springBoot的主要内容,如果未能解决你的问题,请参考以下文章

B/S可以使用springboot作为后台开发框架吗

重学Springboot系列之整合数据库开发框架---上

Netty入门——springboot框架开发一个简单的服务器端和客户端

SpringBoot启动报错“Consider defining a bean of type ‘xxx.mapper.UserMapper‘ in your configuration.“(代码片段

SpringBoot自动装配流程源码分析

SpringBoot框架的权限管理系统