Hello Folks in this post I’m going to provide you the code of the Covid 19 Tracker which I created Last year and demonstrated over my youtube channel.
The problem is on that tutorial I forgot to add one important point which is Remote site Settings. So before you start writing Code make sure you create a remote site setting for the API.
To add a remote site setting:
- From Setup, enter Remote Site Settings in the Quick Find box, then select Remote Site Settings.
- Click New Remote Site.
- Enter a descriptive term for the Remote Site Name.
- Enter the URL (https://api.covid19api.com)for the remote site.
- Optionally, enter a description of the site.
- Click Save.
Sample of the Covid 19 Tracker (In the video tutorial code is not optimized so you can see the change in the code)
Now you can start creating your Lightning Component & Apex Controller
Apex Class Covid19Controller
Apex Class Covid19Parser
Lightning Component Covid19Tracker
For the video tutorial check this out