Rakesh
Rakesh4mo ago

Background tasks

Hi, how to return response and do some background tasks. Like this
app.get('/', (req, res) => {
res.on('finish', () => {
console.log('Response finished sending');
// Perform cleanup tasks, logging, etc.
});

res.send('Hello World!');
});
app.get('/', (req, res) => {
res.on('finish', () => {
console.log('Response finished sending');
// Perform cleanup tasks, logging, etc.
});

res.send('Hello World!');
});
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?