Skip to content

Instantly share code, notes, and snippets.

@ivargrimstad
Created September 4, 2015 06:10
Show Gist options
  • Save ivargrimstad/c368221fa079285856e7 to your computer and use it in GitHub Desktop.
Save ivargrimstad/c368221fa079285856e7 to your computer and use it in GitHub Desktop.
Microservices in Java - Java EE 7 example
@ApplicationPath("/")
public class ApplicationConfig extends Application {
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> resources = new HashSet<>();
resources.add(HelloResource.class);
return resources;
}
}
@Path("hello")
public class HelloResource {
@GET
public Response greet() {
return Response.ok("Hello World").build();
}
}
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment