Skip to content

Commit 81385b9

Browse files
authored
Merge pull request #3721 from lemon1964/patch-1
Update part3c.md
2 parents 737dff1 + 8a6112e commit 81385b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/3/en/part3c.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ const Note = mongoose.model('Note', noteSchema)
392392
To avoid authentication issues with the password variable in index.js, we need to create a .env file by running npm install dotenv in the command line. Then, let's create the .env file in the root of your directory. In that file, you should place your URI:
393393

394394
```
395-
MONGODB_URL="mongodb+srv://fullstack:[email protected]/?retryWrites=true&w=majority&appName=db"
395+
MONGODB_URI="mongodb+srv://fullstack:[email protected]/?retryWrites=true&w=majority&appName=db"
396396
```
397397
Don't forget to replace the string with your details.
398398
Once the .env file is ready, remember to add it to your .gitignore file to prevent pushing the password to Git:
@@ -404,7 +404,7 @@ Once the .env file is ready, remember to add it to your .gitignore file to preve
404404
Then, in your index.js file, make the necessary changes with the following line so that your code can access the URL in your .env file:
405405

406406
```
407-
const url = process.env.MONGODB_URL;
407+
const url = process.env.MONGODB_URI;
408408
409409
```
410410

0 commit comments

Comments
 (0)