mirror of
https://github.com/go-gitea/gitea.git
synced 2024-06-06 07:56:19 +02:00
23 lines
457 B
Go
23 lines
457 B
Go
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package websocket
|
|
|
|
import (
|
|
"code.gitea.io/gitea/modules/web"
|
|
"code.gitea.io/gitea/services/context"
|
|
"code.gitea.io/gitea/services/websocket"
|
|
)
|
|
|
|
func Init(r *web.Route) {
|
|
m := websocket.Init()
|
|
|
|
r.Any("/-/ws", func(ctx *context.Context) {
|
|
err := m.HandleRequest(ctx.Resp, ctx.Req)
|
|
if err != nil {
|
|
ctx.ServerError("HandleRequest", err)
|
|
return
|
|
}
|
|
})
|
|
}
|