-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
64 lines (63 loc) · 2.15 KB
/
Copy pathindex.js
File metadata and controls
64 lines (63 loc) · 2.15 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module.exports = function() {
const faker = require('faker');
const _ = require('lodash');
const nCards = 20;
const nUsers = 10;
const nPosts = 100;
const nComments = 500;
return {
cards: _.times(nCards, function(n) {
return {
id: n+1,
title: faker.commerce.productName(),
disclaimer: faker.lorem.sentence(3),
text: faker.lorem.sentence(40),
author: faker.name.findName(),
avatarUrl: faker.image.avatar(),
imageUrl: faker.image.imageUrl(300,150,"animals"),
}
}),
users: _.times(nUsers, function(n) {
return {
id: n+1,
name: faker.name.findName(),
username: faker.internet.userName(),
email: faker.internet.email(),
address: {
street: faker.address.streetName(),
suite: faker.address.secondaryAddress(),
city: faker.address.city(),
zipcode: faker.address.zipCode(),
geo: {
lat: faker.address.latitude(),
lng: faker.address.longitude()
}
},
phone: faker.phone.phoneNumber(),
website: faker.internet.url(),
company: {
name: faker.company.companyName(),
catchPhrase: faker.company.catchPhrase(),
bs: faker.company.bs()
}
}
}),
posts: _.times(nPosts, function(n) {
return {
id: n+1,
userId: _.random(1,nUsers),
title: faker.lorem.sentence(20),
text: faker.lorem.paragraph(6),
}
}),
comments: _.times(nComments, function(n) {
return {
id: n+1,
postId: _.random(1,nPosts),
name: faker.name.findName(),
email: faker.internet.email(),
text: faker.lorem.sentence(40),
}
}),
}
}