Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I NEED HELP! ! ! ! ! INCUDE SCREENSHOT for each questions. Follow along with the lecture content ( slides / video ) which refer
I NEED HELP! INCUDE SCREENSHOT for each questions.
Follow along with the lecture content slidesvideo which refer to "Homework Assignment" as your guide and starting point.In this week's files you are given "bankindex.ejs" and "accountssummary.ejs" for you to use. "accountssummary.ejs" is similar to the example used within the class video. It should receive an object "accounts" which is an array of objects, each having an accountId, name, and balance. This should match the fields from your BankDB database Thus, this should be the page that is used to render the current balance of all known accounts. The "bankindex.ejs" file should be rendered as the "homelanding page when you first connect to your webapp via the browser. It has two parts. The first is a form with a button to display all balances. It does a POST to the accountssummary endpoint which should be connected to the "accountssummary.ejs" page we just described. It then has a second form with a few fields accountIdA accountIdB, amount its purpose is to allow the user to 'transfer' money from one account to another. This will POST to the transfer endpoint.
Points for this assignment are awarded by completing the following criteria:
Create a bank.js application that starts a webserver and waits for requests.
Your webserver should displayrender "bankindex.ejs" at the endpoint.
When the user clicks 'Show Balances' it should properly POST to accountssummary and render "accountssummary.ejs"
The accountssummary request should properly connect to your database such that the page from the last step accurately displays the data from the BankDB database.
When the user clicks 'Transfer' it should properly POST to transfer and render some result page that tells the user the request is complete. A static pagetext is sufficient and no additional database logic is necessary for this part
For Part be sure to have gone over "Parsing Parameters" and "Callbacks"
Add the appropriate logic to perform the transfer of funds within the BankDB records.
a The funds should be correctly removed from accountIdA
b The funds should be correctly added to accountIdB
c Verify that both accounts do indeed exist before performing the transfer
d Verify that accountIDA has sufficient funds before performing the transfer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started