From f2d3b8f9f1d4a797f8460bb43d65bd67f9c69743 Mon Sep 17 00:00:00 2001 From: coopcool Date: Sat, 6 Feb 2021 14:24:47 -0500 Subject: [PATCH 1/3] atmLAB --- expressLAB.js | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 expressLAB.js diff --git a/expressLAB.js b/expressLAB.js new file mode 100644 index 0000000..1776ae1 --- /dev/null +++ b/expressLAB.js @@ -0,0 +1,67 @@ + +const express = require('express'); +const app = express (); + +app.get('/', (req, res) => { + res.send('

Hello, World!

'); +}); + +//account.balance = balance; + // account.deposit = function (depositAmount) { + + // newBalance = account.balance - depositAmount; + // console.log("Your balance is now " + newBalance); +// if (newBalance <= 0) { + // console.log("You have insufficient funds!!!"); + // } +//}; + + +app.get('/balance', (req, res) => { + res.send(8000); + +}); + +app.delete('/withdraw', (req, res) => { + res.send('

Withdraw

'); + +}); +app.put('/deposit', (req, res) => { + res.send('

Deposit

'); + +}); + +app.listen(3000, () => { + console.log('Server established on port 3000'); +}); + + +//var account = function (name, balance){ + + // account.name = name; + // account.balance = balance; + + //account.deposit = function (depositAmount) { + // newBalance = account.balance - depositAmount; + //console.log("Your balance is now " + newBalance); + // if (newBalance <= 0) { + // console.log("You have insufficient funds!!!"); + // } + // }; + + // account.withdraw = function (withdrawAmount){ + // newBalance = account.balance - withdrawAmount; + // console.log("Your balance is now " + newBalance); + // if (newBalance <= 0) { + // console.log("You have insufficient funds!!!"); + // } + + // }; + + // /account.transfer = function (transferAmount){ + + // } + + // console.log("Name: " + name + "; Balance: " + balance); + // } + \ No newline at end of file From 854ba3dd7dfc5d9edbef3e9d268e30b70a8f856b Mon Sep 17 00:00:00 2001 From: coopsmit26 <74632611+coopsmit26@users.noreply.github.com> Date: Mon, 8 Feb 2021 11:17:56 -0500 Subject: [PATCH 2/3] Update expressLAB.js --- expressLAB.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/expressLAB.js b/expressLAB.js index 1776ae1..106b8ad 100644 --- a/expressLAB.js +++ b/expressLAB.js @@ -6,20 +6,9 @@ app.get('/', (req, res) => { res.send('

Hello, World!

'); }); -//account.balance = balance; - // account.deposit = function (depositAmount) { - - // newBalance = account.balance - depositAmount; - // console.log("Your balance is now " + newBalance); -// if (newBalance <= 0) { - // console.log("You have insufficient funds!!!"); - // } -//}; - app.get('/balance', (req, res) => { res.send(8000); - }); app.delete('/withdraw', (req, res) => { @@ -64,4 +53,4 @@ app.listen(3000, () => { // console.log("Name: " + name + "; Balance: " + balance); // } - \ No newline at end of file + From 881a9babf74168ab9aa3546187f1412ed6557c79 Mon Sep 17 00:00:00 2001 From: coopsmit26 <74632611+coopsmit26@users.noreply.github.com> Date: Sat, 20 Feb 2021 20:32:11 -0500 Subject: [PATCH 3/3] Update expressLAB.js --- expressLAB.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expressLAB.js b/expressLAB.js index 106b8ad..7dbe30f 100644 --- a/expressLAB.js +++ b/expressLAB.js @@ -11,7 +11,7 @@ app.get('/balance', (req, res) => { res.send(8000); }); -app.delete('/withdraw', (req, res) => { +app.get('/withdraw', (req, res) => { res.send('

Withdraw

'); });