Last active
July 30, 2019 14:53
-
-
Save ivargrimstad/2d2fee6193e33bc554b7 to your computer and use it in GitHub Desktop.
Microservices in Java - Swarm example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ApplicationPath("/") | |
public class ApplicationConfig extends Application { | |
@Override | |
public Set<Class<?>> getClasses() { | |
Set<Class<?>> resources = new HashSet<>(); | |
resources.add(HelloResource.class); | |
return resources; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("hello") | |
public class HelloResource { | |
@GET | |
public Response greet() { | |
return Response.ok("Hello World").build(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependencies> | |
<dependency> | |
<groupId>org.wildfly.swarm</groupId> | |
<artifactId>wildfly-swarm-jaxrs</artifactId> | |
<version>1.0.0.Alpha4</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.wildfly.swarm</groupId> | |
<artifactId>wildfly-swarm-plugin</artifactId> | |
<version>1.0.0.Alpha4</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>package</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment