【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:
相关推荐
czlczl200209252 分钟前
KRaft原理
java·zookeeper
紫丁香20 分钟前
高并发面试4
后端·面试·高并发
毕设源码-朱学姐39 分钟前
【开题答辩全过程】以 基于SSM的宜佳家具电商平台为例,包含答辩的问题和答案
java
精神小伙就是猛41 分钟前
使用go-zero快速搭建一个微服务(一)
开发语言·后端·微服务·golang
丘比特惩罚陆42 分钟前
【无标题】
后端·gitee
客卿1231 小时前
最小生成树(贪心)--构造回文串(字符串 + 回文判断 + 构造)
java·开发语言·算法
天启HTTP1 小时前
多线程环境下,动态IP怎么分配最合理
java·服务器·网络
hzb666661 小时前
xd_day32-day40
java·javascript·学习·安全·web安全·tomcat·php
东北甜妹1 小时前
Python脚本
java·开发语言·前端
乐天_乐聊1 小时前
在 IM 项目里落地 Skill + MCP:我给 V-IM RPO 做了一套可被 AI 直接调用的消息能力
后端