Server uses demo data

This commit is contained in:
2016-02-02 13:24:44 +08:00
parent 5186a2fea8
commit 8678dd220b
2 changed files with 3 additions and 9 deletions
+3 -9
View File
@@ -1,16 +1,10 @@
var config = require('config'),
orm = require('../../orm').configure(config.get('database')),
Tasks = require('../../db/models/task').instance(orm);
Tasks = require('../../db/models/task').instance(orm),
demoData = require('../../public/javascripts/data/demo.json');
Tasks.destroy({where: {}}).then(function() {
Tasks.bulkCreate([
{content: 'Welcome to HackFlowy!', isCompleted: false},
{content: 'An open-source WorkFlowy clone', isCompleted: false},
{content: 'Built using Backbone + Socket.IO', isCompleted: false},
{content: 'Desyncr pulled this together in a few hours to learn Backbone', isCompleted: false},
{content: 'Feel free to try it out and hack on it', isCompleted: false},
{content: 'Good Luck!', isCompleted: false}
]);
Tasks.bulkCreate(demoData);
});
orm.sync();