mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
32 lines
802 B
JavaScript
32 lines
802 B
JavaScript
import { Meteor } from 'meteor/meteor';
|
|
import { LinksCollection } from '/imports/api/links';
|
|
|
|
async function insertLink({ title, url }) {
|
|
await LinksCollection.insertAsync({ title, url, createdAt: new Date() });
|
|
}
|
|
|
|
Meteor.startup(async () => {
|
|
// If the Links collection is empty, add some data.
|
|
if (await LinksCollection.find().countAsync() === 0) {
|
|
await insertLink({
|
|
title: 'Do the Tutorial',
|
|
url: 'https://www.meteor.com/tutorials/react/creating-an-app',
|
|
});
|
|
|
|
await insertLink({
|
|
title: 'Follow the Guide',
|
|
url: 'https://guide.meteor.com',
|
|
});
|
|
|
|
await insertLink({
|
|
title: 'Read the Docs',
|
|
url: 'https://docs.meteor.com',
|
|
});
|
|
|
|
await insertLink({
|
|
title: 'Discussions',
|
|
url: 'https://forums.meteor.com',
|
|
});
|
|
}
|
|
});
|