Skip to main content

Environment Variables

Create an .env file#

All Boiler Room boilerplates require you to create a .env file in the root of your application:

touch .env

Included in your template is a sample .env file called .env.demo. This is just for reference purposes. Please delete this file once you have created your own .env file.

Add a Node environment variable#

As a minimum requirement, your .env file should include a NODE_ENV variable. See here for more deatils on the importance of the NODE_ENV variable.

NODE_ENV = development

Add your MongoDB connection string#


This step is only neccessary if you chose MongoDB to be inlcuded in your template.

In order to connect to a database, you must include a connection string to a MongoDB database in your .env file.

You have two options for running and connecting to a MongoDB instance:

  • You can run and connect to a local MongoDB instance running on your machine.
  • You can connect to a (free) Mongo Atlas cluster running in the cloud. (Recommended)

Either way, you will need to add your MonogDB connection string to your .env file as follows:

DB_URI = your-mongo-db-connection-string-goes-here