export interface Environment {
  nodeEnv: string;
  dbUrl: string;
  baseUrl: string;
  awsSecretKey: string;
  awsAccessKey: string;
  region: string;
  s3Bucket: string;
}

export function env(): Environment {
  let dbUrl ="";
  
  if (process.env.NODE_MODE === "production") {
    dbUrl = process.env.DB_URL_PRODUCTION;
  }else if (process.env.NODE_MODE === "development") {
    dbUrl = process.env.DB_URL_DEVELOPMENT;
  }else if (process.env.NODE_MODE === "staging") {
    dbUrl = process.env.DB_URL_STAGING;
   }
   
     console.log(dbUrl);
   
  return {
    nodeEnv: process.env.NODE_MODE,
    dbUrl: dbUrl,
    baseUrl: process.env.BASE_URL,
    awsSecretKey: process.env.aws_access_key,
    awsAccessKey: process.env.aws_secret_key,
    region: process.env.region,
    s3Bucket: process.env.s3_bucket,
  };
}
