Ejemplo n.º 1
0
 public APIGatewayProxyResponse Handle(APIGatewayProxyRequest request, ILambdaContext context)
 {
     return(new Responder().Respond(response =>
     {
         ChameleonGame.Create().LeaveRoom(
             request.GetChameleonRoomCode(),
             request.GetChameleonPersonIdHeader());
         response.StatusCode = 204;
         response.Body = "";
     }));
 }
Ejemplo n.º 2
0
 public APIGatewayProxyResponse Handle(APIGatewayProxyRequest request, ILambdaContext context)
 {
     return(new Responder().Respond(response =>
     {
         var status = ChameleonGame.Create().GetRoomStatus(
             request.GetChameleonRoomCode(),
             request.GetChameleonPersonIdHeader());
         response.StatusCode = 200;
         response.Body = JsonConvert.SerializeObject(status);
         response.Headers.Add("Content-Type", "application/json");
     }));
 }
Ejemplo n.º 3
0
        public APIGatewayProxyResponse Handle(APIGatewayProxyRequest request, ILambdaContext context)
        {
            return(new Responder().Respond(response =>
            {
                var body = JObject.Parse(request.Body);
                var voteToken = body["Vote"];

                ChameleonGame.Create().Vote(
                    request.GetChameleonRoomCode(),
                    request.GetChameleonPersonIdHeader(),
                    voteToken.ToString());

                response.StatusCode = 204;
                response.Body = "";
            }));
        }