Richard Allred
2019-05-23 497620c4d1bcb410267c56351432f87fb3aee5a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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();
    }
}