Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
cf130c70
Commit
cf130c70
authored
Jul 26, 2017
by
Tim Neutkens
Committed by
GitHub
Jul 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefix process.env to avoid inconsistency (#2647)
parent
37531726
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
env-config.js
examples/with-universal-configuration/env-config.js
+1
-1
index.js
examples/with-universal-configuration/pages/index.js
+1
-3
No files found.
examples/with-universal-configuration/env-config.js
View file @
cf130c70
const
prod
=
process
.
env
.
NODE_ENV
===
'production'
module
.
exports
=
{
'BACKEND_URL'
:
prod
?
'https://api.example.com'
:
'https://localhost:8080'
'
process.env.
BACKEND_URL'
:
prod
?
'https://api.example.com'
:
'https://localhost:8080'
}
examples/with-universal-configuration/pages/index.js
View file @
cf130c70
/* global BACKEND_URL */
export
default
()
=>
(
<
div
>
Loading
data
from
{
BACKEND_URL
}
<
/div
>
<
div
>
Loading
data
from
{
process
.
env
.
BACKEND_URL
}
<
/div
>
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment