From f275ee2f6050c2789a43679cdf865f1273a3a6fd Mon Sep 17 00:00:00 2001 From: eloisa-castro Date: Sat, 4 Apr 2020 00:23:54 -0300 Subject: [PATCH] =?UTF-8?q?Resolu=C3=A7=C3=A3o=20dos=20exerc=C3=ADcios=201?= =?UTF-8?q?=20a=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- semana20/aula2/exercicio1.txt | 31 +++++++++++++++++++++++++++++++ semana20/aula2/exercicio2.txt | 8 ++++++++ semana20/aula2/exercicio3.txt | 9 +++++++++ 3 files changed, 48 insertions(+) create mode 100644 semana20/aula2/exercicio1.txt create mode 100644 semana20/aula2/exercicio2.txt create mode 100644 semana20/aula2/exercicio3.txt diff --git a/semana20/aula2/exercicio1.txt b/semana20/aula2/exercicio1.txt new file mode 100644 index 0000000..eea9c8c --- /dev/null +++ b/semana20/aula2/exercicio1.txt @@ -0,0 +1,31 @@ +a. Não. Consegui entender o código completamente. + +b. "Missing input" + +c. "Missing input" + +d. "Missing email" + +e. "Invalid password" + +f. "User is correct" + +g. Devemos alterar para o seguinte código: + + if (!user.email) { + return { + statusCode: 422 + body: JSON.stringify({ message: "Missing email" }) + }; + } + +h. O objeto de entrada deve ser: +{ + "user": { + "info": { + "name": "Astrodev", + "email": "astrodev@f4.com.br", + "password": "123456" + } + } +} \ No newline at end of file diff --git a/semana20/aula2/exercicio2.txt b/semana20/aula2/exercicio2.txt new file mode 100644 index 0000000..2f41f4c --- /dev/null +++ b/semana20/aula2/exercicio2.txt @@ -0,0 +1,8 @@ +exports.handler = async (event) => { + const response = { + statusCode: 200, + body: JSON.stringify("Olá mundo, sou uma mensagem da AWS") + } + return response +} + \ No newline at end of file diff --git a/semana20/aula2/exercicio3.txt b/semana20/aula2/exercicio3.txt new file mode 100644 index 0000000..3f5e3b5 --- /dev/null +++ b/semana20/aula2/exercicio3.txt @@ -0,0 +1,9 @@ +exports.handler = async (event) => { + const soma = JSON.parse(event.num1) + JSON.parse(event.num2) + const response = { + statusCode: 200, + body: JSON.stringify(`Soma: ${soma}`) + } + return response +} + \ No newline at end of file