adding java app

This commit is contained in:
Richard Allred
2019-06-17 08:44:20 -04:00
parent 030f3351a1
commit 0f618dcf35
3 changed files with 142 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package com.redhat.training.example.swarmhelloworld.rest;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import java.net.InetAddress;
@Path("/")
public class ServerHostEndPoint {
@GET
@Produces("text/plain")
public Response doGet() throws Exception {
String host = InetAddress.getLocalHost().getHostName();
return Response.ok("I am running on server "+host+" Version 1.0 \n").build();
}
}