Unverified Commit 83860091 authored by Michael Novotny's avatar Michael Novotny Committed by GitHub

Removes `PORT` from `.env` concatenation example (#51063)

This is to [avoid confusion](https://github.com/vercel/next.js/issues/32603#issuecomment-996751692) about being able to set Next.js's port via `.env`, which is currently not allowed.
parent 9bc73dbc
...@@ -57,12 +57,11 @@ This loads `process.env.DB_HOST`, `process.env.DB_USER`, and `process.env.DB_PAS ...@@ -57,12 +57,11 @@ This loads `process.env.DB_HOST`, `process.env.DB_USER`, and `process.env.DB_PAS
Next.js will automatically expand variables that use `$` to reference other variables e.g. `$VARIABLE` inside of your `.env*` files. This allows you to reference other secrets. For example: Next.js will automatically expand variables that use `$` to reference other variables e.g. `$VARIABLE` inside of your `.env*` files. This allows you to reference other secrets. For example:
```txt filename=".env" ```txt filename=".env"
HOSTNAME=localhost TWITTER_USER=vercel
PORT=8080 TWITTER_URL=https://twitter.com/$TWITTER_USER
HOST=http://$HOSTNAME:$PORT
``` ```
In the above example, `process.env.HOST` would be set to `http://localhost:8080`. In the above example, `process.env.TWITTER_URL` would be set to `http://twitter.com/vercel`.
> **Note**: If you need to use variable with a `$` in the actual value, it needs to be escaped e.g. `\$`. > **Note**: If you need to use variable with a `$` in the actual value, it needs to be escaped e.g. `\$`.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment