【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:
相关推荐
2401_85439108几秒前
Spring Boot大学生就业招聘系统的开发与部署
java·spring boot·后端
Amor风信子1 分钟前
华为OD机试真题---跳房子II
java·数据结构·算法
虽千万人 吾往矣21 分钟前
golang gorm
开发语言·数据库·后端·tcp/ip·golang
杨荧27 分钟前
【JAVA开源】基于Vue和SpringBoot的洗衣店订单管理系统
java·开发语言·vue.js·spring boot·spring cloud·开源
2401_8576100337 分钟前
SpringBoot实现:校园资料分享平台开发指南
服务器·spring boot·php
陈逸轩*^_^*1 小时前
Java 网络编程基础
java·网络·计算机网络
这孩子叫逆1 小时前
Spring Boot项目的创建与使用
java·spring boot·后端
星星法术嗲人1 小时前
【Java】—— 集合框架:Collections工具类的使用
java·开发语言
一丝晨光1 小时前
C++、Ruby和JavaScript
java·开发语言·javascript·c++·python·c·ruby
天上掉下来个程小白1 小时前
Stream流的中间方法
java·开发语言·windows