Skip to content

Commit

Permalink
remove existing logs
Browse files Browse the repository at this point in the history
  • Loading branch information
atembamanu committed Apr 13, 2020
1 parent f2475b3 commit 92423d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/covid19.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module.exports = server => {
try {
const data = fs.readFileSync(path + '/access.log', 'utf8')
const lines = data.split('\n');
// remove one line, starting at the first position

lines.splice(-1, 1);
// join the array back into a single string

const finalData = lines.join('\n');
res.end(finalData);
next();
Expand Down

0 comments on commit 92423d7

Please sign in to comment.