Skip to content

Commit 9e83d08

Browse files
committed
Adds lastUpdated to JSON response data
1 parent c308b15 commit 9e83d08

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ app.get('/', (req, res) => {
6767
if (source === 1) {
6868
if (format.toLowerCase() === 'json') {
6969
return getJSONData().then(result => {
70-
return res.json(result);
70+
return res.json({ ...result, lastUpdated: new Date() });
7171
}).catch(error => errorHandler(error, req, res));
7272
}
7373

lib/worldoMeters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports.getWorldoMetersTable = async ({
2020
});
2121
const { data, worldStats } = await api.getWorldoMetersData(countryCode);
2222
if (format === 'json') {
23-
return { data, worldStats };
23+
return { data, worldStats, lastUpdated: new Date() };
2424
}
2525

2626
let rank = 1;

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)