Skip to content

Commit

Permalink
✨ feat: Add WebSocket endpoint at /ws
Browse files Browse the repository at this point in the history
Set up a new route in the Gin router to handle WebSocket connections
using the existing handleConnections function. This allows for
real-time communication features in the application.

Related issue: YJU-OKURA#80
  • Loading branch information
yuminn-k committed Apr 24, 2024
1 parent 715fb9a commit 30bcb2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ func setupRouter(db *gorm.DB, jwtService services.JWTService) *gin.Engine {
initializeSwagger(router)
userController, classBoardController, classCodeController, classScheduleController, classUserController, attendanceController, classUserService, googleAuthController, createClassController, chatController, liveClassController := initializeControllers(db, redisClient)

// WebSocket 연결을 위한 라우터 설정
router.GET("/ws", func(c *gin.Context) {
handleConnections(c.Writer, c.Request)
})

setupRoutes(router, userController, classBoardController, classCodeController, classScheduleController, classUserController, attendanceController, classUserService, googleAuthController, createClassController, chatController, liveClassController, jwtService)
return router
}
Expand Down

0 comments on commit 30bcb2f

Please sign in to comment.