4、自定義SpringBoot配置

目錄:

1、創建application:依次點擊File -> Project Structure -> 右鍵main -> new folder,輸入文件名resources -> 右鍵resources選擇Resources -> 右鍵項目中已創建的resources,選擇new file,在彈出框中輸入application.yml

 

2、在application.yml中輸入自定義配置

 

server:
    tomcat:
        uri-encoding: UTF-8	# 服務器編碼
        max-threads: 1000	#最大線程數
        min-spare-threads: 30	#
    port: 8088	# 自定義訪問端口號
    connection-timeout: 5000	# 請求超時時間,5秒
    servlet:
      context-path: /test	# 自定義項目訪問根路徑

 

3、啓動項目並訪問localhost:8088/test/index

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章