From f91f91dcb14304884faa781fcf465a9193257251 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 27 May 2020 14:17:43 +0100 Subject: [PATCH] Add unstable routing for now --- clientapi/routing/routing.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 205807722..2926cf275 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -285,6 +285,18 @@ func Setup( }), ).Methods(http.MethodPut, http.MethodOptions) + // TODO: Remove this if/when sytest is fixed! + unstableMux.Handle("/sendToDevice/{eventType}/{txnID}", + internal.MakeAuthAPI("send_to_device", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { + vars, err := internal.URLDecodeMapValues(mux.Vars(req)) + if err != nil { + return util.ErrorResponse(err) + } + txnID := vars["txnID"] + return SendToDevice(req, device, eduProducer, transactionsCache, vars["eventType"], &txnID) + }), + ).Methods(http.MethodPut, http.MethodOptions) + r0mux.Handle("/account/whoami", internal.MakeAuthAPI("whoami", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { return Whoami(req, device)