mirror of
https://github.com/p-stream/providers.git
synced 2026-01-11 20:10:33 +00:00
652 B
652 B
makeSimpleProxyFetcher
Make a fetcher to use with p-stream/simple-proxy. This is for making a proxiedFetcher, so you can run this library in the browser.
Example
import { targets, makeProviders, makeDefaultFetcher, makeSimpleProxyFetcher } from '@p-stream/providers';
const proxyUrl = 'https://your.proxy.workers.dev/';
const providers = makeProviders({
fetcher: makeDefaultFetcher(fetch),
proxiedFetcher: makeSimpleProxyFetcher(proxyUrl, fetch),
target: targets.BROWSER,
});
Type
function makeSimpleProxyFetcher(proxyUrl: string, fetchApi: typeof fetch): Fetcher;