Rakesh
Rakesh
TtRPC
Created by Rakesh on 9/10/2024 in #❓-help
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!');
});
2 replies