Function getOriginUrlByEnvironment

  • Retrieves the origin URL based on the current environment setting.

    This function fetches the current environment from local storage and returns the corresponding base URL from the APP_BASE_URL object. If the environment is not set or found, it defaults to the current window's origin URL.

    Returns string

    The origin URL based on the current environment or the window's origin URL.

    // Assuming local storage has 'CURRENT_ENVIRONMENT' set to 'development'
    const originUrl = getOriginUrlByEnvironment();
    console.log(originUrl); // Outputs the base URL for the 'development' environment