springboot之端⼝设置和contextpath的配置⽅式⽬录
端⼝设置和contextpath的配置
端⼝设置
ContextPath配置
Springboot中添加contextPath
profile配置
端⼝设置和contextpath的配置
端⼝设置
Spring boot 默认端⼝是8080,如果想要进⾏更改的话,只需要修改applicatoin.properties⽂件,在配置⽂件中加⼊:server.port= 9090
常⽤配置:
>>>>>>>>>>>#
###EMBEDDED SERVER CONFIGURATION (ServerProperties)
>>>>>>>>>>>#
spring怎么读取配置#server.port=8080
#server.address= # bind to a specific NIC
#server.session-timeout= # session timeout in seconds
#the context path, defaults to '/'
#t-path=/spring-boot
#server.servlet-path= # the servlet path, defaults to '/'
#at.access-log-pattern= # log pattern of the access log
#at.access-log-enabled=false # is access logging enabled
#at.protocol-header=x-forwarded-proto # ssl forward headers
#-ip-header=x-forwarded-for
#at.basedir=/tmp # base dir (usually not needed, defaults to tmp)
#at.background-processor-delay=30; # in seconds
#at.max-threads = 0 # number of threads in protocol handler
#at.uri-encoding = UTF-8 # character encoding to use for URL decoding
ContextPath配置
常⽤配置:
>>>>>>>>>>>#
###EMBEDDED SERVER CONFIGURATION (ServerProperties)
>>>>>>>>>>>#
#server.port=8080
#server.address= # bind to a specific NIC
#server.session-timeout= # session timeout in seconds
#the context path, defaults to '/'
#t-path=/spring-boot
#server.servlet-path= # the servlet path, defaults to '/'
#at.access-log-pattern= # log pattern of the access log
#at.access-log-enabled=false # is access logging enabled
#at.protocol-header=x-forwarded-proto # ssl forward headers
#-ip-header=x-forwarded-for
#at.basedir=/tmp # base dir (usually not needed, defaults to tmp)
#at.background-processor-delay=30; # in seconds
#at.max-threads = 0 # number of threads in protocol handler
#at.uri-encoding = UTF-8 # character encoding to use for URL decoding
Springboot中添加contextPath
profile配置
server
context-apth: /spring-boot
以上为个⼈经验,希望能给⼤家⼀个参考,也希望⼤家多多⽀持。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。

发表评论