添加websocket连接
This commit is contained in:
@@ -3,6 +3,7 @@ package router
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"toutoukan/controllers/user"
|
||||
"toutoukan/socket"
|
||||
)
|
||||
|
||||
func SetupRouter() *gin.Engine {
|
||||
@@ -12,6 +13,9 @@ func SetupRouter() *gin.Engine {
|
||||
{
|
||||
apiGroup.POST("/login", user.UserLogin)
|
||||
}
|
||||
r.GET("/socket", func(c *gin.Context) {
|
||||
socket.WebsocketHandler(c)
|
||||
})
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user