Closed danielkimtest closed 3 years ago
Week 4 Step 7 ⬤⬤⬤⬤⬤⬤⬤ | 🕐 Estimated completion: 5-20 minutes
It's now time to connect everything together! (catzapp/index.html, catzapp/script.js, and your Azure function)
twocatz-frontend
branchid
of name1
, name2
, name3
, and name4
respectivelycatzapp/script.js
so that it calls your Azure Function with the 4 names as parametersimg
tags, each with an id
of image1
, image2
, image3
, and image4
respectivelycatzapp/index.html
and catzapp/script.js
:bulb: If your test doesn't pass the first time, it might be because your Azure Function is slow to respond. Simply re-run the job like this.
Open up your LiveServer plugin and start your local server. To test your web app:
⚠️ When you enter FOUR NAMES into each of the text boxes, do FOUR CAT PICTURES show up below?
Now that you should've received strings of base64
from your Azure function call, you need some way to display them for the users.
Please complete after you've viewed the Week 3 livestream! If you haven't yet watched it but want to move on, just close this issue and come back to it later.
Help us improve BitCamp Serverless - thank you for your feedback! Here are some questions you may want to answer:
I found this week's content to be the most fun. I think it really helped connect the dots and was insightful as to why we did what we did in the first two weeks. I do wish sometimes there were refreshers, because often times I needed to use similar code from earlier in the course but I couldn't remember when I learned it. I also wish there was a file that just kind of summed up what we learned each week somewhere with like the key points and maybe like essential fragments of code (for example, the await fetch(url, options) sort of thing so I can easily reference how to make an HTTPS request).
I also really liked having the work sessions as opposed to a live stream. It's nice to be able to talk out the problems, either with instructors or other students, and having people help debug is super nice. Speaking of which, I think something that could be included in a resource page could be different debugging tips: explaining when and how to use console and context.log, how to check it in azure or in the console in vscode, using postman, etc. I often mix up/forget which debugging methods can be used and when, so a resource like that would be super handy.
What was confusing about this week? If you could change or add something to this week, what would you do? Your feedback is valued and appreciated!
feedback commented
Go ahead and merge this branch to main
to move on. Great work finishing this section!
⚠️ If you receive a
Conflicts
error, simply pressResolve conflicts
and you should be good to merge!
Week 4 Step 6 ⬤⬤⬤⬤⬤⬤◯ | 🕐 Estimated completion: 5-20 minutes
One Cat isn't enough ~ Meow
Now that we've got a frontend that can only return one picture, let's take it to the next level and return FOUR pictures at the same time. To do this, let's edit our old twoCatz function.
✅ Task:
twocatz-frontend
branchname1
,name2
,name3
,name4
) and returns four pictures in base64 with the parameters.twocatz/index.js
and test your result with Postman❗Requirements
TWOCATZ_ENDPOINT
secret since you are editing the same function🚧 Test your Work
Open up Postman again since we are testing an API.
⚠️ Make a GET request with the four name parameters. Do you get a JSON object containing
name1
,name2
,name3
, andname4
attributes encoded in base64?