//Decalring the Different Variable and Objects
let total_cases = document.getElementById("totalCases");
let total_death = document.getElementById("totalDeaths");
let total_recovered = document.getElementById("totalRecovered");
let new_cases = document.getElementById("newCases");

// Fetching the Data from the server

//Fetching the World Data
fetch("https://coronavirus-monitor.p.rapidapi.com/coronavirus/worldstat.php", {
		"method": "GET",
		"headers": {
			"x-rapidapi-host": "coronavirus-monitor.p.rapidapi.com",
			"x-rapidapi-key": "53009286a0mshdc8ec356f7aa205p1e0e80jsn5858f548ed53"
		}
	})
	.then(response => response.json().then(data => {
		// console.log(data);
		total_cases.innerHTML = data.total_cases;
		new_cases.innerHTML = data.new_cases;
		total_death.innerHTML = data.total_deaths;
		total_recovered.innerHTML = data.total_recovered;

	})).catch(err => {
		console.log(err);
	});