How do I choose the URL for my Spring Boot webapp?

前端 未结 6 935
粉色の甜心
粉色の甜心 2020-11-30 03:48

I am using Spring Boot to create a web app, and I am not sure how to change the URL from localhost:8080 to something like localhost:8080/myWebApp.

6条回答
  •  甜味超标
    2020-11-30 04:01

    The issue of changing the context path of a Spring application is handled very well in the post titled Spring Boot Change Context Path

    Basically the post discusses multiple ways of realizing this viz.

    1. Java Config
    2. Command Line Arguments
    3. Java System Properties
    4. OS Environment Variables
    5. application.properties in Current Directory
    6. application.properties in the classpath (src/main/resources or the packaged jar file)

提交回复
热议问题