From d3e00ff05e54b3316059fb9ee5c5165bdd7b07a7 Mon Sep 17 00:00:00 2001 From: Timur Date: Tue, 19 Oct 2021 07:31:16 +1000 Subject: [PATCH] fix(curriculum): add note about dotenv package (#43877) * Add NOTE about dotenv package * Update note about `dotenv` * Update curriculum/challenges/english/05-back-end-development-and-apis/basic-node-and-express/use-the-.env-file.md Commit reviewer's suggestion Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> --- .../basic-node-and-express/use-the-.env-file.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/curriculum/challenges/english/05-back-end-development-and-apis/basic-node-and-express/use-the-.env-file.md b/curriculum/challenges/english/05-back-end-development-and-apis/basic-node-and-express/use-the-.env-file.md index e953553f4b..e0f635dd12 100644 --- a/curriculum/challenges/english/05-back-end-development-and-apis/basic-node-and-express/use-the-.env-file.md +++ b/curriculum/challenges/english/05-back-end-development-and-apis/basic-node-and-express/use-the-.env-file.md @@ -22,6 +22,8 @@ Then, in the `/json` GET route handler you created in the last challenge, transf **Note:** If you are using Replit, you cannot create a `.env` file. Instead, use the built-in SECRETS tab to add the variable. +If you are working locally, you will need the `dotenv` package. It loads environment variables from your `.env` file into `process.env`. Install it with `npm install dotenv`. Then, at the top of your `myApp.js` file, import and load the variables with `require('dotenv').config()`. + # --hints-- The response of the endpoint `/json` should change according to the environment variable `MESSAGE_STYLE`