mirror of
https://github.com/sussy-code/providers.git
synced 2026-05-10 20:10:34 +00:00
Merge branch 'docs' of https://github.com/movie-web/providers into docs
This commit is contained in:
commit
4fe2f5ce79
3 changed files with 11 additions and 5 deletions
|
|
@ -4,13 +4,13 @@ When making an instance of the library using `makeProviders()`. It will immediat
|
||||||
This comes with some considerations depending on the environment youre running.
|
This comes with some considerations depending on the environment youre running.
|
||||||
|
|
||||||
## Using `fetch()`
|
## Using `fetch()`
|
||||||
In most cases, you can use the `fetch()` API. This will work in newer versions of node (18 and above) and on the browser.
|
In most cases, you can use the `fetch()` API. This will work in newer versions of Node.js (18 and above) and on the browser.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const fetcher = makeDefaultFetcher(fetch);
|
const fetcher = makeDefaultFetcher(fetch);
|
||||||
```
|
```
|
||||||
|
|
||||||
If you using older version of nodejs. You can use the npm package `node-fetch` to polyfill fetch:
|
If you using older version of Node.js. You can use the npm package `node-fetch` to polyfill fetch:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
|
|
@ -19,9 +19,9 @@ const fetcher = makeDefaultFetcher(fetch);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using fetchers on the browser
|
## Using fetchers on the browser
|
||||||
when using this library on a browser, you will need a proxy. Browser come with a ton of restrictions on when a webrequest can be made, and to bypass those restrictions you will need a cors proxy.
|
When using this library on a browser, you will need a proxy. Browsers come with many restrictions on when a web request can be made, and to bypass those restrictions, you will need a cors proxy.
|
||||||
|
|
||||||
The movie-web team has a proxy pre-made and pre-configured for you to use. for more information you can check out [movie-web/simple-proxy](https://github.com/movie-web/simple-proxy). After installing you can use this proxy like so:
|
The movie-web team has a proxy pre-made and pre-configured for you to use. For more information, check out [movie-web/simple-proxy](https://github.com/movie-web/simple-proxy). After installing, you can use this proxy like so:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const fetcher = makeSimpleProxyFetcher("https://your.proxy.workers.dev/", fetch);
|
const fetcher = makeSimpleProxyFetcher("https://your.proxy.workers.dev/", fetch);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,12 @@ export default defineNuxtConfig({
|
||||||
'@/assets/css/main.css',
|
'@/assets/css/main.css',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
build: {
|
||||||
|
transpile: [
|
||||||
|
"chalk"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
modules: [
|
modules: [
|
||||||
// https://github.com/nuxt-modules/plausible
|
// https://github.com/nuxt-modules/plausible
|
||||||
'@nuxtjs/plausible',
|
'@nuxtjs/plausible',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "docus-starter",
|
"name": "providers-docs",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue