-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Examples] Remove with-universal-configuration-runtime (#15268)
- Loading branch information
Showing
5 changed files
with
3 additions
and
96 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,4 @@ | ||
# With universal runtime configuration | ||
Next.js automatically supports Environment Variable loading as of Next.js 9.4. | ||
You can [read more about it in the blog post](https://nextjs.org/blog/next-9-4#new-environment-variables-support). | ||
|
||
This example show how to set custom environment variables for your application at runtime using the `publicRuntimeConfig` key in `next.config.js` | ||
|
||
For documentation see: https://github.com/vercel/next.js#exposing-configuration-to-the-server--client-side | ||
|
||
## How to use | ||
|
||
### Using `create-next-app` | ||
|
||
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-universal-configuration-runtime with-universal-configuration-runtime-app | ||
# or | ||
yarn create next-app --example with-universal-configuration-runtime with-universal-configuration-runtime-app | ||
``` | ||
|
||
### Download manually | ||
|
||
Download the example: | ||
|
||
```bash | ||
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-universal-configuration-runtime | ||
cd with-universal-configuration-runtime | ||
``` | ||
|
||
Install it and run: | ||
|
||
```bash | ||
npm install | ||
API_URL='https://example.com' npm run dev | ||
# or | ||
yarn | ||
API_URL='https://example.com' yarn dev | ||
``` | ||
|
||
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). | ||
Visit [the documentation](https://nextjs.org/docs/basic-features/environment-variables) to learn how to use Environment Variables support in Next.js 9.4+ and the [Environment Variables Example](/examples/environment-variables) to see it on action. |
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
examples/with-universal-configuration-runtime/package.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.