Documentation
    Preparing search index...

    Defines the structure of an environment variable validation definition. Used to add new environment variable validations to the start/env.ts file.

    const envValidation: EnvValidationNode = {
    leadingComment: 'Database configuration',
    variables: {
    DB_HOST: 'Env.schema.string()',
    DB_PORT: 'Env.schema.number.optional({ port: 5432 })',
    DB_PASSWORD: 'Env.schema.string.optional()'
    }
    }
    type EnvValidationNode = {
        leadingComment?: string;
        variables: Record<string, string>;
    }
    Index

    Properties

    leadingComment?: string

    Optional leading comment to write above the variable definitions. Helps group related environment variables together.

    variables: Record<string, string>

    A key-value pair of environment variables and their validation schemas. The key is the environment variable name, the value is the validation code.

    {
    * MY_VAR: 'Env.schema.string.optional()',
    * API_KEY: 'Env.schema.string()'
    * }