Skip to content

Commit

Permalink
Added more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan L. Smith committed May 1, 2024
1 parent 7453e19 commit 29ac35d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,16 @@ app.get('/import', (req, res) => {
console.error('Error fetching records:', err);
}

console.log('All done. You have a new output file.');

fs.writeFile('./output.json', JSON.stringify(data,), (err) => {
if (err) {
console.error('Error writing file:', err);
} else {
console.log('JSON data saved to', data.length);
}
});
console.log(`All done. Processed ${data.length} records.`);
res.send(`All done. Processed ${data.length} records.`);

// fs.writeFile('./output.json', JSON.stringify(data,), (err) => {
// if (err) {
// console.error('Error writing file:', err);
// } else {
// console.log('JSON data saved to', data.length);
// }
// });
});


Expand Down

0 comments on commit 29ac35d

Please sign in to comment.