Skip to content

Instantly share code, notes, and snippets.

@tmarwen
Forked from ivargrimstad/Application.java
Created October 26, 2015 15:52
Show Gist options
  • Save tmarwen/70532eff7f76c70b19b7 to your computer and use it in GitHub Desktop.
Save tmarwen/70532eff7f76c70b19b7 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