Running the application

Next, we need to run our application and trigger API methods. Add a file named application.properties to your application resources folder:

spring.application.name= Journaler API 
server.port= 9000 

This will represent the configuration of our local development environment. Thanks to Spring Boot, it is possible to externalize configuration so we can work with the same application code in different environments.

So, what have we done in these three lines?

  • spring.application.name: We assigned the application name
  • server.port: We assigned the port on which our application will start and listen

What else can be configured? First of all, we can configure logging. Let's extend our application.properties:

... logging.level.root=INFO ...

Get Building Applications with Spring 5 and Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.