Skip to content

Latest commit

 

History

History
34 lines (19 loc) · 2 KB

File metadata and controls

34 lines (19 loc) · 2 KB

Environment Configuration 🌍

.env files

This document provides guidelines on managing environment-specific configurations for your application. It includes explanations of various environment files, usage tips, and important security notes.

Environment Files 📁

Different .env files are used for different environments to ensure proper configuration:

  • .env_development: Used for the development environment. It includes configurations like the database URL, port number, and JWT settings specific to development.

  • .env_production: Used for the production environment. This file should contain the production database URL and any production-specific configurations.

  • .env_staging: Used for the staging environment, typically used for testing before deployment to production. It includes a staging database URL and other staging-specific settings.

Usage Tips 🚀

  1. Selecting the Environment File:

    • Make sure to load the appropriate .env file based on the environment where your application is running. This can be configured in your deployment scripts or development environment settings.
  2. Environment-Specific Configurations:

    • Adjust settings such as PORT, SIGNING_ALGO, and JWT_SECRET to fit the requirements of each environment. Ensure that each environment file has the correct and necessary configuration for smooth operation.

Security Notes 🔒

  • Sensitive Information:

    • Keep sensitive data, such as database URLs and JWT secrets, secure and avoid exposing them in public repositories or source code.
  • .gitignore Configuration:

    • Add all .env files to your .gitignore file to prevent them from being tracked by version control systems. This practice helps to maintain the confidentiality of your configuration details.

By adhering to these guidelines, you can effectively manage environment-specific settings and ensure that your application remains secure and well-configured across different stages of development and deployment.