source: bus-n-go-pavel-216049/bus-n-go-backend/src/main/kotlin/mk/ukim/finki/busngobackend/config/WebSocketConfig.kt

Last change on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago

split group project and individual project into two separate folders

  • Property mode set to 100644
File size: 920 bytes
Line 
1package mk.ukim.finki.busngobackend.config
2
3import org.springframework.context.annotation.Configuration
4import org.springframework.messaging.simp.config.MessageBrokerRegistry
5import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker
6import org.springframework.web.socket.config.annotation.StompEndpointRegistry
7import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
8
9@Configuration
10@EnableWebSocketMessageBroker
11class WebSocketConfig : WebSocketMessageBrokerConfigurer {
12 override fun registerStompEndpoints(registry: StompEndpointRegistry) {
13 registry.addEndpoint("/ws").setAllowedOrigins("http://localhost:4200", "http://localhost:4200/").withSockJS()
14 }
15
16 override fun configureMessageBroker(registry: MessageBrokerRegistry) {
17 registry.setApplicationDestinationPrefixes("/app")
18 registry.enableSimpleBroker("/topic")
19 }
20}
Note: See TracBrowser for help on using the repository browser.