diff --git a/expressLAB.js b/expressLAB.js new file mode 100644 index 0000000..7dbe30f --- /dev/null +++ b/expressLAB.js @@ -0,0 +1,56 @@ + +const express = require('express'); +const app = express (); + +app.get('/', (req, res) => { + res.send('

Hello, World!

'); +}); + + +app.get('/balance', (req, res) => { + res.send(8000); +}); + +app.get('/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); + // } +