Files
R2m1liA 53555a31c0 refactor: 重构项目结构
- 将server端相关依赖单独防止在server中
2025-12-17 12:34:03 +08:00

22 lines
417 B
Go

package api
import (
"context"
"net/http"
"git.jinshen.cn/remilia/push-server/interval/server/api/handler"
"git.jinshen.cn/remilia/push-server/interval/server/ws"
"github.com/go-chi/chi/v5"
)
func NewRouter(h *ws.Hub, ctx context.Context) http.Handler {
r := chi.NewRouter()
r.Get("/ws", ws.Handler(ctx, h))
r.Post("/health", handler.Health)
r.Post("/push/{topic}", handler.PushHandler(h))
return r
}