【SpringBoot】SpringBoot项目关于默认port以及context path的配置 application.yml

application.yml

server port 端口号

配置/修改默认端口号
yaml 复制代码
# server configuration
  server:
    port: 8080

context path 虚拟目录

配置/修改默认虚拟目录
yaml 复制代码
# server configuration
  server:
   servlet:
    context-path: /

spring configuration

yaml 复制代码
# spring configuration
spring:
  application:
    name: spring-boot-starter-web
    version: 1.0.0
    description: Spring Boot Starter Web
    author:
      name: "Johan"
      email: "johan@johan.com"
      url: "https://johan.com"
      company: "Johan"
      company-url: "https://johan.com"
      
      license:
        name: "Apache License 2.0"
        url: "https://www.apache.org/licenses/LICENSE-2.0"
        copyright: "Copyright (c) 2021 Johan"
        copyright-year: "2021"
        copyright-holder: "Johan"
        copyright-holder-url: "https://johan.com"
        copyright-license: "Apache License 2.0"
        copyright-license-url: "https://www.apache.org/licenses/LICENSE-2.0"
        copyright-license-text: |
          Licensed under the Apache License, Version 2.0 (the "License");
          you may not use this file except in compliance with the License.
          You may obtain a copy of the License at

              http://www.apache.org/licenses/LICENSE-2.0

          Unless required by applicable law or agreed to in writing, software
          
          
          
          
          distributed under the License is distributed on an "AS IS" BASIS, 
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.    
          See the License for the specific language governing permissions and
          limitations under the License.

logging configuration

yaml 复制代码
# logging configuration
#logging:
#  level:
相关推荐
Rain的Java大神之路2 分钟前
Spring AI 2.0 GA 深度复盘:Java 后端做 AI 的分水岭,到底画在哪?
java·后端·aigc
青石路24 分钟前
不依赖 Spring,你会如何自实现 RabbitMQ 消息的消费(二)
后端·rabbitmq
Csvn1 小时前
Nginx 可观测性与工程化:指标、告警与发布回滚演练
后端·nginx
光泽雨1 小时前
IActionResult 是 ASP.NET Core Web API 中非常常用的一种控制器方法返回类型
后端·asp.net
如夏倾城2 小时前
进程状态模型详解:从三态、五态到 Linux 状态码映射
java·linux·服务器
唐老板2 小时前
前端和后端,转 AI 全栈怎么转
前端·后端
掘金安东尼2 小时前
中国移动 OAS 是什么:智能体开放服务空间、四项能力与「自研」说法的核实
人工智能·后端
小南家的青蛙2 小时前
JVM 参数调优实战指南
java·jvm
JuiceFS3 小时前
缓存命中率 99.96%,小文件数量减少 99.92%:启智机器人 JuiceFS 生产实践
人工智能·后端·机器人
程序员鱼皮3 小时前
Antigravity 保姆级实战教程,从 0 到 1 万字干货!
前端·后端·ai编程