feat: Hub接收RESTful API的消息
This commit is contained in:
@ -4,13 +4,15 @@ import (
|
||||
"net/http"
|
||||
|
||||
"git.jinshen.cn/remilia/push-server/interval/api/handler"
|
||||
"git.jinshen.cn/remilia/push-server/interval/hub"
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
func NewRouter() http.Handler {
|
||||
func NewRouter(h *hub.Hub) http.Handler {
|
||||
r := chi.NewRouter()
|
||||
|
||||
r.Post("/health", handler.Health)
|
||||
r.Post("/push/{topic}", handler.PushHandler(h))
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user