Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change zeit fetch to vercel fetch #21913

Merged
merged 9 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/with-vercel-fetch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @vercel/fetch example

This example shows how to use [`@vercel/fetch`](https://www.npmjs.com/package/@vercel/fetch) in a Next.js application.

## Deploy your own

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-vercel-fetch&project-name=with-vercel-fetch&repository-name=with-vercel-fetch)

## How to use

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:

```bash
npx create-next-app --example with-vercel-fetch with-vercel-fetch-app
# or
yarn create next-app --example with-vercel-fetch with-vercel-fetch-app
```
4 changes: 4 additions & 0 deletions examples/with-vercel-fetch/fetch/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import createFetch from '@vercel/fetch'

// since we aren't providing createFetch a fetcher it will use node-fetch as the fetcher
export default createFetch()
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "with-zeit-fetch",
"name": "with-vercel-fetch",
"version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@zeit/fetch": "5.1.1",
"@vercel/fetch": "6.1.0",
"next": "latest",
"node-fetch": "2.6.1",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"unfetch": "4.1.0"
"react": "17.0.1",
"react-dom": "17.0.1",
"unfetch": "4.2.0"
},
"license": "MIT"
}
21 changes: 0 additions & 21 deletions examples/with-zeit-fetch/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions examples/with-zeit-fetch/fetch/server.js

This file was deleted.