/
dummydata.js
50 lines (46 loc) · 1.34 KB
/
dummydata.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'use strict';
var mongoose = require('mongoose'),
User = mongoose.model('User'),
Thing = mongoose.model('Thing');
/**
* Populate database with sample application data
*/
//Clear old things, then add things in
Thing.find({}).remove(function() {
Thing.create({
name : 'HTML5 Boilerplate',
info : 'HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites.',
awesomeness: 10
}, {
name : 'AngularJS',
info : 'AngularJS is a toolset for building the framework most suited to your application development.',
awesomeness: 10
}, {
name : 'Karma',
info : 'Spectacular Test Runner for JavaScript.',
awesomeness: 10
}, {
name : 'Express',
info : 'Flexible and minimalist web application framework for node.js.',
awesomeness: 10
}, {
name : 'MongoDB + Mongoose',
info : 'An excellent document database. Combined with Mongoose to simplify adding validation and business logic.',
awesomeness: 10
}, function() {
console.log('finished populating things');
}
);
});
// Clear old users, then add a default user
User.find({}).remove(function() {
User.create({
provider: 'local',
name: 'Test User',
email: 'test@test.com',
password: 'test'
}, function() {
console.log('finished populating users');
}
);
});