Skip to content

Commit

Permalink
馃悰 FIX: broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadawais committed Apr 1, 2022
1 parent 2967341 commit 44c0f8a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions utils/getBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module.exports = async (
logScale = x => (x === 0 ? undefined : Math.log(x));
}

const statesURL = `https://corona.lmao.ninja/v2/states`;
const countriesURL = `https://corona.lmao.ninja/v2/countries`;
const statesURL = `https://disease.sh/v3/covid-19/states`;
const countriesURL = `https://disease.sh/v3/covid-19/countries`;

const [err, res] = await to(
axios.get(states ? statesURL : countriesURL)
Expand Down
2 changes: 1 addition & 1 deletion utils/getCountries.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = async (
if (!countryName && !states && !bar) {
sortValidation(sortBy, spinner);
const [err, response] = await to(
axios.get(`https://corona.lmao.ninja/v2/countries`)
axios.get(`https://disease.sh/v3/covid-19/countries`)
);
handleError(`API is down, try again later.`, err, false);
let allCountries = response.data;
Expand Down
2 changes: 1 addition & 1 deletion utils/getCountry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const handleError = require('cli-handle-error');
module.exports = async (spinner, table, states, countryName, options) => {
if (countryName && !states && !options.chart) {
const [err, response] = await to(
axios.get(`https://corona.lmao.ninja/v2/countries/${countryName}`)
axios.get(`https://disease.sh/v3/covid-19/countries/${countryName}`)
);
exitCountry(err, spinner, countryName);
err && spinner.stopAndPersist();
Expand Down
4 changes: 3 additions & 1 deletion utils/getCountryChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const contrib = require('blessed-contrib');
module.exports = async (spinner, countryName, { chart, log }) => {
if (countryName && chart) {
const [err, response] = await to(
axios.get(`https://corona.lmao.ninja/v2/historical/${countryName}`)
axios.get(
`https://disease.sh/v3/covid-19/historical/${countryName}`
)
);
handleError(`API is down, try again later.`, err, false);
if (response.status === 404) {
Expand Down
2 changes: 1 addition & 1 deletion utils/getStates.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = async (
if (states && !bar) {
sortStatesValidation(sortBy, spinner);
const [err, response] = await to(
axios.get(`https://corona.lmao.ninja/v2/states`)
axios.get(`https://disease.sh/v3/covid-19/states`)
);
handleError(`API is down, try again later.`, err, false);
let allStates = response.data;
Expand Down
2 changes: 1 addition & 1 deletion utils/getWorldwide.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const handleError = require('cli-handle-error');

module.exports = async (table, states, json) => {
const [err, response] = await to(
axios.get(`https://corona.lmao.ninja/v2/all`)
axios.get(`https://disease.sh/v3/covid-19/all`)
);
handleError(`API is down, try again later.`, err, false);

Expand Down

0 comments on commit 44c0f8a

Please sign in to comment.