@scolastico-dev/env-helper
    Preparing search index...

    Function $urlWithoutTrailingSlash

    • Retrieves a URL string from an environment variable, validates it, and ensures it doesn't end with a trailing slash.

      Parameters

      • key: string

        The name of the environment variable

      • Optionaldef: string

        Optional default URL string to use if the environment variable is not set

      Returns string

      The validated URL string with any trailing slash removed

      Will throw an error if the URL is invalid, or if the environment variable is missing and no default is provided