What will you write to add the .env file to your express application? 1

What will you write to add the .env file to your express application?

require( 'dotenv' ).config()

Here is what the above code is Doing:
1. We’re requiring the dotenv module.
2. We’re calling the config() method on the dotenv module.
3. We’re passing the config() method an object with a path property.
4. The path property is set to the path of the .env file.

Similar Posts