{"size": 1294, "ext": "js", "max_stars_repo_path": "server/main.js", "max_stars_repo_name": "sebastian-ruiz/airframe-meteor", "max_stars_repo_stars_event_min_datetime": "2021-12-25T21:24:51.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-25T21:24:51.000Z", "max_issues_repo_path": "server/main.js", "max_issues_repo_name": "sebastian-ruiz/airframe-meteor", "max_issues_repo_issues_event_min_datetime": "2021-05-11T09:43:24.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-23T19:32:47.000Z", "max_forks_repo_path": "server/main.js", "max_forks_repo_name": "sebastian-ruiz/airframe-meteor", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 24.8846153846, "max_line_length": 67, "alphanum_fraction": 0.627511592}
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
import { LinksCollection } from '/imports/api/links';

const SEED_EMAIL = 'admin@admin';
const SEED_PASSWORD = 'admin';

function insertLink({ title, url }) {
  LinksCollection.insert({title, url, createdAt: new Date()});
}

Meteor.startup(() => {
  if (!Accounts.findUserByEmail(SEED_EMAIL)) {
    // create example account
    Accounts.createUser({
      email: SEED_EMAIL,
      password: SEED_PASSWORD,
    });
    // also automatically verify the email address
    defaultAccount = Accounts.findUserByEmail(SEED_EMAIL);
    defaultAccount.emails[0].verified = true;
    Meteor.users.update(defaultAccount._id, {
      $set: {
        emails: defaultAccount.emails
      }
    });
  }

  // If the Links collection is empty, add some data.
  if (LinksCollection.find().count() === 0) {
    insertLink({
      title: 'Do the Tutorial',
      url: 'https://www.meteor.com/tutorials/react/creating-an-app'
    });

    insertLink({
      title: 'Follow the Guide',
      url: 'http://guide.meteor.com'
    });

    insertLink({
      title: 'Read the Docs',
      url: 'https://docs.meteor.com'
    });

    insertLink({
      title: 'Discussions',
      url: 'https://forums.meteor.com'
    });
  }
});
