Customize your project's environment

Default SourceLair environment

SourceLair, depending on your project type, will inject the following environment variables in every process you run your project. Processes are your server, your terminal and any other commands that spawn a console window.

Defining custom environment variables

Your project might need to have custom evnrinment variables defined, such as the database URL, or other configuration variables like creadentials etc. SourceLair supports dotenv configuration for your environment, meaning that you can create a .env file in your project - which should be ignored by .git - which can contain all these variables.

For example, if you’d like to configure the DATABASE_URL environment variable used for dynamically configuring your database connection using libraries such as dj-database-url and another variable called EMAIL_SECRET, you can create a .env file like the following: