Closed paryswest closed 3 years ago
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:
If it weren't for the videos, I'd be lost. These videos were nothing short of a Godsend. THANK. GOODNESS!
The pace was MUCH better. I would say that the shortening of the videos helped things IMMENSELY. Please keep this format.
I would definitely keep it like this for now.
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!
This week was definitely not confusing. It was really week 2 that was the killer for everyone. I wouldn't change a thing to be honest. However, for the next camp go around, I would still do the following:
a) Make sure that people who joined definitely know one language well enough. It would definitely help
OR
b) Kind of make them a little more on the beginner's level because if it weren't for the vids, I'd been lost, which has both a positive and negative to it. The vids were done well - so well that its easy to understand. However, if I did this on my own, I would be a little afraid of my being confused. However, if it were on a more basic level, I'd probably have been less confused (generally speaking, because this is advanced stuff).
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 3 Step 8 ⬤⬤⬤⬤⬤⬤⬤⬤◯ | 🕐 Estimated completion: 10-20 minutes
Exposed!!
✅ Task:
Modify the
deepsecrets
Azure Function todeepsecrets/index.js
to thedeepsecrets
branch❗ Make sure to return your message in this format:
🚧 Test Your Work
To test your work, send your Twilio number a text message. You should still receive a text back that contains a message similar to the one below, but now the second secret returned will be random, and no longer the most recent secret stored!
1. Modifying the SQL Query
In your
createDocument
function, you'll first want to modify the original SQL query to now query for all secrets inside your container.:question: How do I select all secrets?
```js const querySpec = { query: "SELECT * from c" }; ```2. Selecting a Random Item
Next, you'll want to select a random secret by:
Math.floor()
andMath.random()
):question: How do I generate a random number for the index?
The `Math.floor()` function returns the [floor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) of the given number - ie. the largest integer less than or equal to a given number. In the example below, the generated random number will never be greater than `items.length`. ```js var random_value = Math.floor(items.length * Math.random()); ```:bulb: Make sure to change your responseMessage to return the correct index of
items
.