diff --git a/src/main/java/com/ntlab/irisserver/WebSocketConfig.java b/src/main/java/com/ntlab/irisserver/WebSocketConfig.java index 7376824..b2c1f5a 100644 --- a/src/main/java/com/ntlab/irisserver/WebSocketConfig.java +++ b/src/main/java/com/ntlab/irisserver/WebSocketConfig.java @@ -2,6 +2,7 @@ import com.ntlab.irisserver.websockets.HelloWorldWebSocket; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.config.annotation.*; import org.springframework.web.socket.server.standard.ServerEndpointExporter; @@ -11,7 +12,7 @@ @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { - //registry.addHandler(unitWebSocketHandler, "/unit").setAllowedOrigins("*"); + registry.addHandler((WebSocketHandler) helloWorldWebSocket(), "/ws"); } @Bean diff --git a/src/main/java/com/ntlab/irisserver/resources/HelloWorld.java b/src/main/java/com/ntlab/irisserver/resources/HelloWorld.java index 408aa78..8f305d7 100644 --- a/src/main/java/com/ntlab/irisserver/resources/HelloWorld.java +++ b/src/main/java/com/ntlab/irisserver/resources/HelloWorld.java @@ -4,15 +4,13 @@ import javax.ws.rs.GET; import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; @Component @Path("/hello") public class HelloWorld { @GET public String getHello() { - return "WebSocketのデモの追加。12/11-11:13"; + return "WebSocketのデモの追加。12/11-11:30"; } }