From ca5df1da5d50ef4012850c915cc3ab51e3b1ee35 Mon Sep 17 00:00:00 2001 From: LordOfDexterity <54269414+LordOfDexterity@users.noreply.github.com> Date: Wed, 16 Oct 2019 18:17:39 +0530 Subject: [PATCH 1/4] PULL_REQUEST_TEMPLATE.md changed name of param1 to darthvader ;) --- routes/route.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/routes/route.js b/routes/route.js index cb8a48c..6820740 100644 --- a/routes/route.js +++ b/routes/route.js @@ -11,30 +11,30 @@ router.post("add", (req, res) => { }); router.post("/power", (req, res) => { - let param1 = req.body.param1; + let darthvader = req.body.darthvader; let param2 = req.body.param2; - + res.json({ - result: Math.pow(param1, param2), + result: Math.pow(darthvader, param2), meta: { success: true, - message: `Calculated ${param1} raised to the power ${param2}`, + message: `Calculated ${} raised to the power ${param2}`, code: 200 } }); }); router.post("/factorial", (req, res) => { - const { param1 } = req.body; + const { darthvader } = req.body; try { - let result = parseInt(param1, 10); + let result = parseInt(darthvader, 10); if (result < 0) { return res.json({ meta: { success: false, - message: `${param1} is a negative number`, + message: `${darthvader} is a negative number`, code: 400 } }); @@ -46,7 +46,7 @@ router.post("/factorial", (req, res) => { result, meta: { success: true, - message: `Calculated ${param1} factorial`, + message: `Calculated ${darthvader} factorial`, code: 200 } }); @@ -63,14 +63,14 @@ router.post("/factorial", (req, res) => { router.post("/ceil", (req, res) => { try { - const { param1 } = req.body; + const { darthvader } = req.body; - let result = Math.ceil(parseFloat(param1, 10)); + let result = Math.ceil(parseFloat(darthvader, 10)); res.json({ result, meta: { success: true, - message: `Calculated ${param1} ceil`, + message: `Calculated ${darthvader} ceil`, code: 200 } }); From 77537c0aa45765950fe38afae4072971e4ea3864 Mon Sep 17 00:00:00 2001 From: LordOfDexterity <54269414+LordOfDexterity@users.noreply.github.com> Date: Wed, 23 Oct 2019 20:59:34 +0530 Subject: [PATCH 2/4] route.js //hacktober2019 --- routes/route.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/route.js b/routes/route.js index 6820740..59af9c1 100644 --- a/routes/route.js +++ b/routes/route.js @@ -9,7 +9,7 @@ router.get("/check", (req, res) => { router.post("add", (req, res) => { // Add logic here }); - +// hacktoberfest2019 router.post("/power", (req, res) => { let darthvader = req.body.darthvader; let param2 = req.body.param2; @@ -49,7 +49,7 @@ router.post("/factorial", (req, res) => { message: `Calculated ${darthvader} factorial`, code: 200 } - }); + }); //hacktoberfest2019 } catch (err) { res.json({ meta: { From d6e6578ace38b8ea728901cc79bf26962f9bdb90 Mon Sep 17 00:00:00 2001 From: LordOfDexterity <54269414+LordOfDexterity@users.noreply.github.com> Date: Wed, 23 Oct 2019 21:25:08 +0530 Subject: [PATCH 3/4] route.js --- routes/route.js | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/route.js b/routes/route.js index 59af9c1..891047e 100644 --- a/routes/route.js +++ b/routes/route.js @@ -8,6 +8,7 @@ router.get("/check", (req, res) => { router.post("add", (req, res) => { // Add logic here + res.send("sum can be printed here"); }); // hacktoberfest2019 router.post("/power", (req, res) => { From 7c6071035e787537f1dc59319b4f98d1a4ce66ba Mon Sep 17 00:00:00 2001 From: LordOfDexterity <54269414+LordOfDexterity@users.noreply.github.com> Date: Wed, 23 Oct 2019 21:27:25 +0530 Subject: [PATCH 4/4] route.js --- routes/route.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/route.js b/routes/route.js index 891047e..1b99752 100644 --- a/routes/route.js +++ b/routes/route.js @@ -4,7 +4,7 @@ const router = express.Router(); router.get("/check", (req, res) => { res.send("Congratulations! Your app works! :)"); -}); +}); // comment router.post("add", (req, res) => { // Add logic here