Created
May 20, 2018 10:46
-
-
Save FagnerMartinsBrack/2194e0819e6696f54ee4b6dc397838d4 to your computer and use it in GitHub Desktop.
(Medium) - HTTP retry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
const isDuplicateRequest = (requestBody) => { | |
return isRequestIdInDatabase(requestBody.uniqueRequestId); | |
}; | |
// ... | |
app.use((req, res) => { | |
if (isDuplicateRequest(req.body)) { | |
res.end(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment