Routes returns the chi router for mounting at /api/v0/desktop.
()
| 74 | |
| 75 | // Routes returns the chi router for mounting at /api/v0/desktop. |
| 76 | func (a *API) Routes() http.Handler { |
| 77 | r := chi.NewRouter() |
| 78 | r.Get("/vnc", a.handleDesktopVNC) |
| 79 | r.Post("/action", a.handleAction) |
| 80 | r.Route("/recording", func(r chi.Router) { |
| 81 | r.Post("/start", a.handleRecordingStart) |
| 82 | r.Post("/stop", a.handleRecordingStop) |
| 83 | }) |
| 84 | return r |
| 85 | } |
| 86 | |
| 87 | func (a *API) handleDesktopVNC(rw http.ResponseWriter, r *http.Request) { |
| 88 | ctx := r.Context() |