refactor: 重构项目结构

- 将server端相关依赖单独防止在server中
This commit is contained in:
2025-12-17 12:32:21 +08:00
parent 1bc9c6a924
commit 53555a31c0
23 changed files with 15 additions and 17 deletions

View File

@ -0,0 +1,21 @@
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
}