Skip to content

Instantly share code, notes, and snippets.

@ivargrimstad
Last active July 30, 2019 14:54
Show Gist options
  • Save ivargrimstad/8bbc2b1085948a38fcdd to your computer and use it in GitHub Desktop.
Save ivargrimstad/8bbc2b1085948a38fcdd to your computer and use it in GitHub Desktop.
Microservices in Java - Boot example
@Configuration
@EnableAutoConfiguration
@EnableEurekaClient
@RestController
public class Application {
@RequestMapping("/")
public String home() {
return "Hello World";
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix</artifactId>
<version>1.0.3.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
</dependencies>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment