unbound-fetch
v1.0.8
Published
> 1000 subrequests for cloudflare workers
Downloads
14
Maintainers
Readme
Unbound Fetch
Uses DurableObjects to get up to 500k subrequests.
Installation
npm i unbound-fetch --saveUsage
wrangler.toml
durable_objects.bindings = [
{ name = "UnboundFetch", class_name = "UnboundFetch" }
]
migrations = [
{ tag = "v1", new_classes = [ "UnboundFetch" ] }
]index.ts
import { createUnboundFetch, UnfoundFetch } from "unbound-fetch";
interface IEnv {
UnboundFetch: DurableObjectNamespace<UnboundFetch>;
}
export default {
fetch(req: Request, env: IEnv, ctx: ExecutionContext) {
const fetch = createUnboundFetch({
binding: env.UnboundFetch,
});
return fetch(
"https://api.github.com/search/repositories?sort=stars&order=desc&q=language:javascript"
);
},
};
export const { UnboundFetch };Example
For end to end 10k requests example please check /example folder.
License
MIT
