'Run Spring Boot Project with base directory - localhost:8080/demo/

I have setup a run configuration in eclipse but it's running in localhost:8080 but I want it to run in localhost:8080/demo/ but it's not working. I have attached the run configuration and application properties file enter image description here

enter image description here

can anyone help me to run spring boot project in localhost:8080/demo/



Solution 1:[1]

In your controller by annotation @RequestMapping(path = "/demo") or by annotation on method @GetMapping("/demo")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mateusz-tbh