Skip to content

Commit

Permalink
[Examples] Remove with-universal-configuration-runtime (#15268)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfades authored Jul 17, 2020
1 parent 48621b3 commit a866937
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 96 deletions.
34 changes: 0 additions & 34 deletions examples/with-universal-configuration-runtime/.gitignore

This file was deleted.

40 changes: 3 additions & 37 deletions examples/with-universal-configuration-runtime/README.md
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.
5 changes: 0 additions & 5 deletions examples/with-universal-configuration-runtime/next.config.js

This file was deleted.

12 changes: 0 additions & 12 deletions examples/with-universal-configuration-runtime/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions examples/with-universal-configuration-runtime/pages/index.js

This file was deleted.

0 comments on commit a866937

Please sign in to comment.