in client/src/js/RemoteStarter.ts [31:55]
static startChallenge(
successCallback: (challengeDetails: ChallengeDetails) => void,
errorCallback: (error: Error) => void
): void {
const url: string = Utils.getConfig().API_URL + Utils.getConfig().API_START_ENDPOINT;
const startRequestData: StartRequestData = {
userId: Utils.getUserId(),
imageWidth: Utils.getMediaStreamInfo().actualWidth,
imageHeight: Utils.getMediaStreamInfo().actualHeight
};
Logger.info(`calling ${url}`);
Logger.info(startRequestData);
axios
.post(url, startRequestData)
.then(function(response: any) {
Logger.info(response);
const challengeDetails: ChallengeDetails = response.data;
Logger.info(challengeDetails);
successCallback(challengeDetails);
})
.catch(function(error: any) {
Logger.error(error);
errorCallback(error);
});
}