In this unit we will focus on combining applications together. We'll do this by handling events triggered by applications.
- ๐ freeCodeCamp.org
- ๐ฟfreeCodeCamp on YouTube provides a wonderful collection of beginning programming courses. I recommend the ๐ฅ JavaScript tutorial.
- ๐ Web Events
- ๐ก Think about the weather. Do you want to use the light if it gets rainy/snowy/chilly/hot?
- ๐ก What about your location? Want to trigger something when you leave a certain area at a certain time?
- ๐ก Think about notifications you get on your phone. Would those be cool to light up the weird dog lamp thing?
- ๐ก What about controlling your lights based on a text message?
- ๐ถ ๐๏ธ The dog lamp LIFX lightbulb
In this unit we'll take a look at a specific Webhook implementations GitHub and Discord.
- ๐ฐ First blog post about "Web hooks" - Wayback machine
- ๐น Web Hooks and the Programmable World of Tomorrow- 2009 talk about Webhooks @ Google
- ๐งฐ Beeceptor
~/Code
directory because I forgot to cd courses
.
- ๐ฟ What is the terminal and why should I use it? - Developer Fundamentals - YouTube
- ๐ฟ What is the file system and why should I learn about it? - Developer Fundamentals - YouTube
- 14 ways to open Command Prompt in Windows 10
- Install Git
- Install Node
- Install npm
- Install Visual Studio Code
- Optional - Connect GitHub with ssh
- ๐ฟ What is my System Path? - Developer Fundamentals - YouTube
- Install ngrok
- Install ngrok to your path - Stack Overflow
Install nodemon:
npm install -g nodemon
npm install netlify-cli -g
- Making asynchronous programming easier with async and await
- Netlify Dev - Local server
- Cloud Computing Providers - GitHub
- ๐ฟ What do tutorials mean when they say my shell? - Developer Fundamentals - YouTube
๐ I figured out what my problem was! After you change environment variables in Netlify, you need to re-deploy. That's the reason it worked once I re-deployed it. I decided to keep the bugs in there so you know that we all make mistakes. Also it should give you some first hand knowledge of how to debug a webhook.
I hope you enjoy the lemonade made from the lemons of that bit ๐s.
In this unit we'll build an entire application that leans almost entirely on the concept of Webhooks. We'll build an idea capturing hotline that transcribes the ideas and then sends you a text message.
The following TwiML will send a text message when set up to handle incoming messages.
<Response>
<Message>You got this!๐ช</Message>
</Response>
This is using a Webhook. When the message comes in, control is passed to your application (it just happens to be in a TwiML Bin), and you return these instructions.
- ๐
<Message>
- Twilio Docs - ๐ TwiML Bins
- ๐
<Say>
- Twilio docs - ๐ Polly Neural voices - Amazon docs
- ๐งฐ Twilio Studio
npm install twilio-cli -g
Optionally on a Mac, you could use Homebrew
brew tap twilio/brew && brew install twilio
Install the Serverless Toolkit plugin:
twilio plugins:install @twilio-labs/plugin-serverless
Serverless Function boilerplate:
exports.handler = (context, event, callback) => {
callback(null, "Hi mom!");
};
Start your local development server
twilio serverless:start
twilio serverless:deploy