-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.env.sample
33 lines (24 loc) · 1.41 KB
/
.env.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# List name value pairs of environment variables that you want to be able to
# access in your JavaScript. This is useful for things like API keys.
api_key=PUT_YOUR_API_KEY_HERE
# Usually, environment variables are written in all caps, but the above example
# is how the key is accessed in the Making Asynchronous Calls example. Rather
# than setting the key in the replit Secret panel as described in the lesson, we
# can set it in a .env file.
# Copy this file to a new file named .env and replace PUT_YOUR_API_KEY_HERE with
# your actual API key. You must do this step yourself, because the .env file is
# listed in the .gitignore file and will not be included in the repository.
# Then, you can access the key in your JavaScript like this
# const apiKey = process.env['api_key']; // or
# const apiKey = process.env.api_key;
# Note that the key is accessed as a property of process.env, not as a
# standalone variable.
# Only the method of starting the project with `npm start` will attempt to load
# the .env file. To run a different file than src/index.js, but while still
# loading the .env file, use the following command:
# $ node --env-file=.env path/to/other/file.js
# where path/to/other/file.js is the path to the file you want to run. The
# --env-file option tells Node.js to load the .env file before running the
# specified file.
# See https://nodejs.org/docs/latest/api/cli.html#--env-fileconfig for more
# information.