Add the following to src> main> resources> application.yml.
application.yml
server:
  port : 8081
Run and verify that it has changed from the default port 8080.
$ curl http://localhost:8080/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
curl: (7) Failed to connect to localhost port 8080: Connection refused
$ curl http://localhost:8081/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    13  100    13    0     0    149      0 --:--:-- --:--:-- --:--:--   149
Hello World!
In the case of src> main> resources> application.properties, write as follows.
application.properties
server.port=8081
        Recommended Posts