startup.js 364 B

1234567891011121314
  1. if (Meteor.isServer) {
  2. Meteor.startup(function () {
  3. if (Images.find().count() === 0) {
  4. for (let i = 1; i < 23; i++) {
  5. Images.insert({
  6. "img_src": "img_" + i + ".jpg",
  7. "img_alt": "image number " + i
  8. });
  9. } // end of for loop
  10. Meteor._debug(Images.find().count());
  11. } // end of if have no images.
  12. });
  13. }