-
Notifications
You must be signed in to change notification settings - Fork 0
/
add.js
62 lines (53 loc) · 1.52 KB
/
add.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
var request = require('request');
var Datastore = require('nedb')
, bd = new Datastore({ filename: './db' });
bd.loadDatabase(function (err) {});
var test_two_mail_1 = {
from : '[email protected]',
to : '[email protected]',
subject : 'Re: What I like',
text : 'I like swimming.'
};
var test_two_mail_2 = {
from : '[email protected]',
to : '[email protected]',
subject : 'Re: What you like?',
text : 'I love to play Counter Strike.'
};
var test_one_mail_1 = {
from : '[email protected]',
to : '[email protected]',
subject : 'What I like',
text : 'I like pizza and ice-cream.'
};
var test_one_mail_2 = {
from : '[email protected]',
to : '[email protected]',
subject : 'What you like?',
text : 'What you like to play: guitar or chests'
};
var test_1_mail_1 = {
from : '1',
to : '[email protected]',
subject : 'from 1 to two',
text : 'This is the text'
};
var test_1_mail_2 = {
from : '[email protected]',
to : '1',
subject : 'from two to 1',
text : 'Is this text the?'
};
var test_1_mail_3 = {
from : 'wtf@hz_kakoi_email.dot.net.org.com.ru.fr.io',
to : '1',
subject : 'Not spam',
text : 'This is spam, param-pam-pam.'
};
var tests=[test_two_mail_1, test_two_mail_2, test_one_mail_1, test_one_mail_2, test_1_mail_1, test_1_mail_2, test_1_mail_3];
for (i=0;i<7;++i) {
request.post('http://localhost:8000/send/' + tests[i].from, tests[i], function (err, res, body) {
console.log(body);
});
//bd.insert(tests[i]);
}