Skip to content

Commit eec8fdb

Browse files
committed
Merge branch 'dev' of https://github.com/WarenGonzaga/covid19-tracker-cli into feature/adaptive-charts
2 parents 57765f9 + b882bc5 commit eec8fdb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const express = require('express'),
66
covid19 = require('./lib/cli'),
77
covid19GFX = require('./lib/cli/gfx'),
88
pkg = require('./package.json'), // package.json info
9-
apiBaseURL = "https://corona.lmao.ninja", // NovelCOVID API
9+
apiBaseURL = "https://corona.lmao.ninja/v2", // NovelCOVID API
1010
port = process.env.port || 7070; // set port
1111

1212
// global route for covid19 tracker
@@ -29,7 +29,7 @@ app.get(['/history/all/:chartType(cases|deaths)?', '/history/'], async (req, res
2929
const userAgent = req.headers['user-agent'],
3030
api = await axios.get(`${apiBaseURL}/all`),
3131
chartType = req.params.chartType || 'cases',
32-
history = await axios.get(`${apiBaseURL}/v2/historical/all?lastdays=all`),
32+
history = await axios.get(`${apiBaseURL}/historical/all?lastdays=all`),
3333
h = history.data;
3434
data = api.data;
3535

@@ -111,7 +111,7 @@ app.get('/history/:country/:chartType(cases|deaths)?', async (req, res, next) =>
111111
countryData = req.params.country,
112112
chartType = req.params.chartType || 'cases',
113113
summary = await axios.get(`${apiBaseURL}/countries/${countryData}`),
114-
history = await axios.get(`${apiBaseURL}/v2/historical/${summary.data.country}?lastdays=all`),
114+
history = await axios.get(`${apiBaseURL}/historical/${summary.data.country}?lastdays=all`),
115115
s = summary.data,
116116
h = history.data;
117117

cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const axios = require('axios'),
44
ora = require('ora'),
55
spinner = ora({ text: 'Loading...'}),
66
covid19 = require('./lib/cli'),
7-
apiBaseURL = "https://corona.lmao.ninja",
7+
apiBaseURL = "https://corona.lmao.ninja/v2",
88
argv = require('yargs')
99
.usage('Usage: $0 <country> [options]')
1010
.example('$0 PH', 'Generate stats for Philippines. ISO 3166-1 is supported')

0 commit comments

Comments
 (0)