Creating the Eureka server main class

Before we start the configuration, we will create the main class. This class will start the Spring Boot application. The Eureka server is embedded in the application. It is a pretty standard Spring Boot application with a single annotation.

The main application class should look like this:

package springfive.airline.eureka;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;@EnableEurekaServer@SpringBootApplicationpublic class EurekaApplication {  public static void main(String[] args) {    SpringApplication.run(EurekaApplication.class, args);  }}

The @EnableEurekaServer ...

Get Spring 5.0 By Example 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.