exponentialBackoffMiddleware
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
If your server returns a 5xx error, it will wait 1, 2, 4, 8, 16, 32, 64, 128... seconds before retrying
import { exponentialBackoffMiddleware } from "https://esm.town/v/stevekrouse/exponentialBackoffMiddleware"
export default exponentialBackoffMiddleware(() => { /* your normal http handler * / })
Example usage: https://www.val.town/v/stevekrouse/BIGweather?v=164#L114
Migrated from folder: Archive/exponentialBackoffMiddleware