dotenv#config TypeScript Examples

The following examples show how to use dotenv#config. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: cleanup-e2e-resources.ts    From amplify-codegen with Apache License 2.0 6 votes vote down vote up
configureAws = (): void => {
  if (!process.env.AWS_ACCESS_KEY_ID || !process.env.AWS_SECRET_ACCESS_KEY) {
    throw new Error('AWS credentials are not configured. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables');
  }

  aws.config.update({
    credentials: {
      accessKeyId: process.env.AWS_ACCESS_KEY_ID,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
      ...(process.env.AWS_SESSION_TOKEN ? { sessionToken: process.env.AWS_SESSION_TOKEN } : {}),
    },
    maxRetries: 10,
  });
}
Example #2
Source File: Config.ts    From l2beat with MIT License 6 votes vote down vote up
export function getConfig(): Config {
  config()

  if (process.env.MOCK_DATA === 'true') {
    return {
      mock: true,
      updatePrecomputed: false,
      rpcUrl: 'https://mock.url',
      etherscanApiKey: 'm0ckk3y',
    }
  }

  return {
    mock: false,
    updatePrecomputed: process.env.UPDATE_PRECOMPUTED === 'true',
    rpcUrl: getEnv('RPC_URL'),
    etherscanApiKey: getEnv('ETHERSCAN_API_KEY'),
  }
}
Example #3
Source File: index.ts    From dicio-api with MIT License 6 votes vote down vote up
(async () => {
  if (process.env.NODE_ENV === 'dev') {
    config({
      path: path.resolve(__dirname, '..', '.env'),
    });
  }

  await database.connect().catch(log);

  const server = new Server();

  server.start(Number(process.env.PORT) || 3333);
})();
Example #4
Source File: base.ts    From gear-js with GNU General Public License v3.0 5 votes vote down vote up
config();
Example #5
Source File: envUtils.ts    From cli with Apache License 2.0 5 votes vote down vote up
config();
Example #6
Source File: firestore.ts    From ts-di-starter with MIT License 5 votes vote down vote up
config();
Example #7
Source File: start.ts    From fosscord-server with GNU Affero General Public License v3.0 5 votes vote down vote up
config();
Example #8
Source File: config.ts    From opensaas with MIT License 5 votes vote down vote up
config({ path: resolve(__dirname, `../../.env.${env}`) });
Example #9
Source File: configuration.ts    From gear-js with GNU General Public License v3.0 5 votes vote down vote up
config();
Example #10
Source File: orgResources.specs.ts    From cli with Apache License 2.0 5 votes vote down vote up
config({path: getEnvFilePath()});
Example #11
Source File: api.ts    From lexicon with MIT License 5 votes vote down vote up
config();
Example #12
Source File: index.ts    From liferay-grow with MIT License 5 votes vote down vote up
constructor() {
    config();
    this.express = Express();
    this.initializeDatabase();
    this.initializeMiddlewares();
    this.initializeControllers();
    this.initializeApollo();
  }
Example #13
Source File: dotenv.ts    From livepeer-com with MIT License 5 votes vote down vote up
// First to come takes precedence as config() never overrides existing env vars.
config({ path: ".env.local" });
Example #14
Source File: tester.ts    From revolt.js with MIT License 5 votes vote down vote up
config();
Example #15
Source File: ormconfig.ts    From office-hours with GNU General Public License v3.0 5 votes vote down vote up
config();
Example #16
Source File: general.test.ts    From ts-google-drive with MIT License 5 votes vote down vote up
config();
Example #17
Source File: index.ts    From misabot-discord with MIT License 5 votes vote down vote up
config();
Example #18
Source File: app.ts    From sixpg with MIT License 5 votes vote down vote up
config();
Example #19
Source File: index.ts    From hand-cricket-bot with GNU General Public License v3.0 5 votes vote down vote up
config();
Example #20
Source File: ormconfig.ts    From domain-driven-hexagon with MIT License 5 votes vote down vote up
// https://github.com/Sairyss/backend-best-practices#configuration

// Initializing dotenv
config();
Example #21
Source File: index.ts    From vt-api with GNU Affero General Public License v3.0 5 votes vote down vote up
config();
Example #22
Source File: dsa.spec.ts    From dsa-connect with MIT License 5 votes vote down vote up
config()
Example #23
Source File: proxy.ts    From NanoRPCProxy with GNU General Public License v3.0 5 votes vote down vote up
config()
Example #24
Source File: ValidatorReport.tsx    From community-repo with GNU General Public License v3.0 5 votes vote down vote up
config();
Example #25
Source File: index.ts    From master-frontend-lemoncode with MIT License 5 votes vote down vote up
config();
Example #26
Source File: test.ts    From dropify with MIT License 5 votes vote down vote up
env = config()
Example #27
Source File: server.ts    From cli with Apache License 2.0 5 votes vote down vote up
config();
Example #28
Source File: index.ts    From adminjs-upload with MIT License 5 votes vote down vote up
config({ path: path.join(__dirname, '../../.env') })
Example #29
Source File: index.test.ts    From aws-secrets-manager-action with MIT License 5 votes vote down vote up
config({ path: resolve(__dirname, "../.env") })