Hey guys, very much stuck on this question
Complete the GET /banks/:vaultname
route. The route should do three things:
- Capture the URL param value of
vaultname
into aconst
variable namedspecificVaultName
. - Create a new variable called
specificVaultAmount
that stores the value of thevault
property of a specific vault in thebanks
object. Utilize thespecificVaultName
variable created in the previous step so that the new variable accesses the vault relative to the value of the URL param. - Send the
specificVaultAmount
variable created in the previous step as a JSON response.
So far I’ve come up with:
app.get(‘/banks/:vaultname’, (req, res, next) => {
const specificVaultName = req.params.vaultname;
let specificVaultAmount = banks[specificVaultName]
res.json(specificVaultAmount)
});
But it doesn’t get the right values, any tips would be much appreciated