Skip to content

Commit 3b3842d

Browse files
combined data
1 parent d19c098 commit 3b3842d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

routes/combined.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const get_data = require('../helpers/fetch-data');
2+
3+
const casesUrl = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv'
4+
const recoveredUrl = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv';
5+
const deathsUrl = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv';
6+
7+
8+
Promise.all([get_data(casesUrl), get_data(recoveredUrl), get_data(deathsUrl)])
9+
.then(result => {
10+
console.log(result)
11+
12+
})
13+
.catch(error => console.log(`Error in promises ${error}`))

0 commit comments

Comments
 (0)