1

I'm working on a Spring rest project with Spring Boot. I follow this instructions https://spring.io/guides/gs/rest-service/. When I run the project, project is working on localhost:8080 as described in the tutorial. But I wanna run this project on localhost:8080/ProjectName. How can I change the project mapping?

İlkay Gunel
  • 712
  • 2
  • 11
  • 24
  • http://stackoverflow.com/questions/24452072/how-do-i-choose-the-url-for-my-spring-boot-webapp – riso Oct 23 '16 at 12:55

1 Answers1

4

If you don't already have one, add an application.properties file to src\main\resources. In that properties file, add 2 properties:

server.contextPath=/ProjectName
server.port=8080

The server.port=8080 is optional

AchillesVan
  • 4,156
  • 3
  • 35
  • 47