Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions expressLAB.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

const express = require('express');
const app = express ();

app.get('/', (req, res) => {
res.send('<h1>Hello, World!</h1>');
});


app.get('/balance', (req, res) => {
res.send(8000);
});

app.get('/withdraw', (req, res) => {
res.send('<h1>Withdraw</h1>');

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

});

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);
// }