-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpopulate.js
110 lines (108 loc) · 2.69 KB
/
populate.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0";
const accounts = [
{
username: "ye",
email: "[email protected]",
password: "password123",
birthDate: "1977-06-08",
firstName: "Kanye",
lastName: "West",
},
{
username: "travisscott",
email: "[email protected]",
password: "password123",
birthDate: "1991-04-30",
firstName: "Travis",
lastName: "Scott",
},
{
username: "kidcudi",
email: "[email protected]",
password: "password123",
birthDate: "1984-01-30",
firstName: "Scott",
lastName: "Mescudi",
},
{
username: "mfdoom",
email: "[email protected]",
password: "password123",
birthDate: "1971-07-13",
firstName: "Daniel",
lastName: "Dumile",
},
{
username: "metroboomin",
email: "[email protected]",
password: "password123",
birthDate: "1993-09-16",
firstName: "Leland",
lastName: "Wayne",
},
{
username: "badgalriri",
email: "[email protected]",
password: "password123",
birthDate: "1988-02-20",
firstName: "Robyn",
lastName: "Fenty",
},
{
username: "beyonce",
email: "[email protected]",
password: "password123",
birthDate: "1981-09-04",
firstName: "Beyoncé",
lastName: "Knowles",
},
{
username: "ladygaga",
email: "[email protected]",
password: "password123",
birthDate: "1986-03-28",
firstName: "Stefani",
lastName: "Germanotta",
},
{
username: "taylorswift",
email: "[email protected]",
password: "password123",
birthDate: "1989-12-13",
firstName: "Taylor",
lastName: "Swift",
},
{
username: "selenagomez",
email: "[email protected]",
password: "password123",
birthDate: "1992-07-22",
firstName: "Selena",
lastName: "Gomez",
},
{
username: "okoca",
email: "[email protected]",
password: "password123",
birthDate: "2004-01-11",
firstName: "Okan",
lastName: "Koca",
},
];
Promise.all(
accounts.map(async (acc) => {
return await fetch("https://localhost/api/auth/register", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(acc),
});
})
)
.then((response) => {
return Promise.all(response.map((res) => res.json()));
})
.then((json) => {
console.log(json);
});