startup.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. // start up function that creates entries in the Websites databases.
  2. Meteor.startup(function () {
  3. // code to run on server at startup
  4. if (!Websites.findOne()) {
  5. console.log("No websites yet. Creating starter data.");
  6. Websites.insert({
  7. title: "Goldsmiths Computing Department",
  8. url: "http://www.gold.ac.uk/computing/",
  9. description: "This is where this course was developed.",
  10. createdOn: new Date()
  11. });
  12. Websites.insert({
  13. title: "University of London",
  14. url: "http://www.londoninternational.ac.uk/courses/undergraduate/goldsmiths/bsc-creative-computing-bsc-diploma-work-entry-route",
  15. description: "University of London International Programme.",
  16. createdOn: new Date()
  17. });
  18. Websites.insert({
  19. title: "Coursera",
  20. url: "http://www.coursera.org",
  21. description: "Universal access to the world’s best education.",
  22. createdOn: new Date()
  23. });
  24. Websites.insert({
  25. title: "Google",
  26. url: "http://www.google.com",
  27. description: "Popular search engine.",
  28. createdOn: new Date()
  29. });
  30. }
  31. });