To use this method, we would need to create a RESTful service, similar to what we did in Chapter 3, Networking with RESTful APIs and Web Socket Services Using Flask (the code that can be found in chapter02/flask_api_server.py, which changes the brightness of a LED (rather than setting it to on/off/blinking), would be a great starting point).
We would also need to expose our Raspberry Pi to the public internet, which would require us to open a port and create a port forwarding rule in our local firewall or router. Then, together with our public IP (or domain name), we could construct a URL and use this directly with the IFTTT Webhook service.
For prototyping ideas and creating demos, a simple alternative to opening up firewalls and creating port forwarding rules could be to use a service such as Local Tunnels (localtunnel.github.io/www) or ngrok (ngrok.com), which can help you expose a device to the internet.
Since this...