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

发布于:2024-06-08 ⋅ 阅读:(130) ⋅ 点赞:(0)

application.yml

server port [端口号]

在这里插入图片描述

配置/修改默认端口号
# server configuration
  server:
    port: 8080

context path [虚拟目录]

在这里插入图片描述

配置/修改默认虚拟目录
# server configuration
  server:
   servlet:
    context-path: /

spring configuration

# 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

# logging configuration
#logging:
#  level:

网站公告

今日签到

点亮在社区的每一天
去签到