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

Removes PORT from .env concatenation example #51063

Merged
merged 3 commits into from
Jun 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```txt filename=".env"
HOSTNAME=localhost
PORT=8080
HOST=http://$HOSTNAME:$PORT
TWITTER_USER=vercel
TWITTER_URL=https://twitter.com/$TWITTER_USER
Comment on lines +60 to +61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TWITTER_USER=vercel
TWITTER_URL=https://twitter.com/$TWITTER_USER
TWITTER_USER=nextjs
TWITTER_URL=https://twitter.com/$TWITTER_USER

```

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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the above example, `process.env.TWITTER_URL` would be set to `http://twitter.com/vercel`.
In the above example, `process.env.TWITTER_URL` would be set to `https://twitter.com/nextjs`.


> **Note**: If you need to use variable with a `$` in the actual value, it needs to be escaped e.g. `\$`.

Expand Down