Files
nashua-holiday-stroll/server/main.js
tparnell 08bfb90652 stop
2018-11-21 21:30:13 -05:00

32 lines
645 B
JavaScript

import { Meteor } from 'meteor/meteor';
import Links from '/imports/api/links';
function insertLink(title, url) {
Links.insert({ title, url, createdAt: new Date() });
}
Meteor.startup(() => {
// If the Links collection is empty, add some data.
if (Links.find().count() === 0) {
insertLink(
'Do the Tutorial',
'https://www.meteor.com/tutorials/react/creating-an-app'
);
insertLink(
'Follow the Guide',
'http://guide.meteor.com'
);
insertLink(
'Read the Docs',
'https://docs.meteor.com'
);
insertLink(
'Discussions',
'https://forums.meteor.com'
);
}
});