config#setupConfig TypeScript Examples

The following examples show how to use config#setupConfig. 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: index.ts    From one-platform with MIT License 6 votes vote down vote up
(async function main() {
  const config = setupConfig();
  const logger = setupLogger();
  const mailer = setupNodeMailer({
    host: config.smtpHost,
    port: 587,
    secure: false,
    tls: {
      rejectUnauthorized: false,
    },
  });

  const agenda = new Agenda({ db: { address: config.mongoURI, collection: 'jobs' } });

  try {
    setupCronTask(agenda, logger, { decryptionKey: config.nsEncryptionKey }, mailer);
    logger.info('Subscription Cron started');
  } catch (error) {
    logger.error(error, 'Failed to start subscription cron');
    process.exit(0);
  }
  // await setupAgenda();
  await setupMongoose(config.mongoURI, logger);
  await startApolloServer(schema, config);
})();