RakeshR
tRPC2y ago
1 reply
Rakesh

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!');
});
Was this page helpful?