mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-16 10:37:25 +02:00
use Chi Router instead of Chi Mux.
This commit is contained in:
parent
a18482b54e
commit
40b986c8be
7 changed files with 13 additions and 143 deletions
|
@ -37,14 +37,14 @@ func New(
|
|||
}
|
||||
}
|
||||
|
||||
func (api *ApiManagerCtx) Mount(r *chi.Mux) {
|
||||
func (api *ApiManagerCtx) Route(r chi.Router) {
|
||||
r.Use(api.Authenticate)
|
||||
|
||||
memberHandler := member.New(api.sessions)
|
||||
r.Mount("/member", memberHandler.Router())
|
||||
r.Route("/member", memberHandler.Route)
|
||||
|
||||
roomHandler := room.New(api.sessions, api.desktop, api.capture)
|
||||
r.Mount("/room", roomHandler.Router())
|
||||
r.Route("/room", roomHandler.Route)
|
||||
|
||||
r.Get("/test", func(w http.ResponseWriter, r *http.Request) {
|
||||
session, _ := r.Context().Value(keySessionCtx).(types.Session)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue