Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HTTP retry
const express = require('express');
console.log(process.version);
const app = express();
app.get('/hello', (req, res) => {
console.log('HANDLING REQUEST');
res.setHeader('content-type', 'application/json');
res.flushHeaders(); // `flushHeaders` to prevent http client from retrying and therefore invoking this handler multiple times.
res.destroy();
});
app.listen(9000, () => {
console.log('Listening');
});
// https://blogs.oracle.com/ravello/beware-http-requests-automatic-retries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.