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?
Asked
Active
Viewed 2,078 times
1
-
http://stackoverflow.com/questions/24452072/how-do-i-choose-the-url-for-my-spring-boot-webapp – riso Oct 23 '16 at 12:55
1 Answers
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
-
Thank you so much for this answer. I didn't have a properties file and I did your answer. Everything is okey. – İlkay Gunel Oct 23 '16 at 13:15