Обновлен gradle и библиотеки

This commit is contained in:
sshkurov
2022-02-03 03:27:09 +03:00
parent a9b97d076b
commit 61cabaaa3b
6 changed files with 106 additions and 78 deletions

View File

@@ -0,0 +1,27 @@
package ru.serega6531.packmate.configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import ru.serega6531.packmate.WebSocketHandler;
@EnableWebSocket
@Configuration
public class WebSocketConfiguration implements WebSocketConfigurer {
private final WebSocketHandler webSocketHandler;
@Autowired
public WebSocketConfiguration(WebSocketHandler webSocketHandler) {
this.webSocketHandler = webSocketHandler;
}
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(webSocketHandler, "/api/ws")
.withSockJS();
}
}