I am running http server which always returns 504:
const express = require('express')
const app = express()
app.get('/', (req, res) => {
console.log('I AM HERE');
res.status(504).send('Not found!!');
})
app.listen(3000, () => console.log('Listening on port 3000!'))
After that, I'm doing request, using got with 5 retries:
const got = require('got');
(async () => {
try {
const response = await got('http://localhost:3000/', {retries: 5});
console.log(response.body);
} catch (error) {
console.log(error.response.body);
}
})();
I'm expecting, that inscription I AM HERE
would be logged 5 times, but it logged only once. What is wrong with my code?