@@ -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
0 commit comments