Environment variable

Add an environment variable as a configuration option. Store the variable MESSAGE_STYLE=uppercase in the .env file.

How to store vaiable in .env file and the os I am using is linux.?

You install the dotenv package in your project, and follow the instructions there. You are going to put that MESSAGE_STYLE=uppercase in a file called .env in the root of your project. Then, following the instructions, you require the dotenv module as soon as possible, so ideally it’s the very first line in the first file.

All it for is to avoid you having to manually set environment variables on your system (ie configuration that is available everywhere)

This is slightly more advanced, but for future reference, if you’re putting the project up on GitHub or wherever, you do not commit that .env file under any circumstances, it needs to be ignored: it’s just for your local system.

Thank you so much …

Hey guys I myself get the answer it might help someone.

I am doing node js from FCC and I got stuck that how should i store my variable in .env file…
ANSWER is go to your root file here that is boilerplate and add a file name it as .env and store variable inside that.

Thankyou