api: Cleanup websocket protocol

This commit cleans up the websocket protocol to be in line with the
documentation.
This commit is contained in:
Tom 2023-07-13 15:54:45 +02:00
parent 16fa721048
commit 1c68893a02
31 changed files with 3549 additions and 120 deletions

View file

@ -84,14 +84,6 @@ func (admin *Admin) HandleRoute(ctx context.Context, route string) (handler http
router := httprouter.New()
{
handler = &httpx.WebSocket{
Context: ctx,
Fallback: router,
Handler: admin.Dependencies.Sockets.Serve,
}
}
// add a handler for the index page
{
index := admin.index(ctx)
@ -161,7 +153,7 @@ func (admin *Admin) HandleRoute(ctx context.Context, route string) (handler http
// add a router for the login page
router.Handler(http.MethodPost, route+"login", admin.loginHandler(ctx))
return
return router, nil
}
func (admin *Admin) loginHandler(ctx context.Context) http.Handler {