Vulcan/server/bootstrap.js

31 lines
701 B
JavaScript
Raw Normal View History

2012-09-18 10:04:26 +10:00
function prepopulateDatabase(){
[
{
headline: 'The first post ever, a link to Hacker News'
, url: 'http://news.ycombinator.com/'
2012-09-27 18:02:22 +02:00
, author: 'Sacha'
2012-09-18 10:04:26 +10:00
, submitted: new Date(2012, 7, 22).getTime()
, votes: 0
, comments: 0
2012-09-27 18:02:22 +02:00
, score: 0
2012-09-18 10:04:26 +10:00
}
, {
headline: 'Another post to fill the page up a little'
, url: 'http://sachagreif.com/'
2012-09-27 18:02:22 +02:00
, author: 'Sacha'
, submitted: new Date(2012, 7, 23).getTime()
2012-09-18 10:04:26 +10:00
, votes: 0
, comments: 0
2012-09-27 18:02:22 +02:00
, score: 0
2012-09-18 10:04:26 +10:00
}
].forEach(function(post){
Posts.insert(post);
});
}
2012-08-22 21:27:22 -04:00
2012-09-29 12:47:40 +09:00
// Meteor.startup(function () {
// if(Posts.find().count() === 0){
// prepopulateDatabase();
// }
// });