providers/.docs/content/5.api-reference/8.makeSimpleProxyFetcher.md

24 lines
654 B
Markdown
Raw Normal View History

2023-09-27 17:00:40 +00:00
# `makeSimpleProxyFetcher`
Make a fetcher to use with [movie-web/simple-proxy](https://github.com/movie-web/simple-proxy). This is for making a proxiedFetcher, so you can run this library in the browser.
## Example
```ts
2023-12-29 16:47:49 +00:00
import { targets, makeProviders, makeDefaultFetcher, makeSimpleProxyFetcher } from '@movie-web/providers';
2023-09-27 17:00:40 +00:00
2023-12-29 16:47:49 +00:00
const proxyUrl = 'https://your.proxy.workers.dev/'
2023-09-27 17:00:40 +00:00
const providers = makeProviders({
fetcher: makeDefaultFetcher(fetch),
proxiedFetcher: makeSimpleProxyFetcher(proxyUrl, fetch),
target: targets.BROWSER,
});
```
## Type
```ts
function makeSimpleProxyFetcher(proxyUrl: string, fetchApi: typeof fetch): Fetcher;
```