-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.js
59 lines (44 loc) · 1.29 KB
/
node.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
var mysql = require('mysql');
var http = require('http');
//var nodemailer = require('nodemailer');
var connection = mysql.createConnection({
host : 'academic-mysql.cc.gatech.edu',
user : 'cs4400_group32',
password : 'AXtzKclB',
database : 'cs4400_group32'
});
connection.connect();
connection.query('select * from `User`', function (error, results, fields) {
if (error) {
console.log(err.code);
console.log(err.fatal);
}
console.log('The solution is: ', results);
});
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
}).listen(8080);
//var transporter = nodemailer.createTransport({
// service: 'gmail',
// auth: {
// user: 'luohaozh@msu.edu',
// pass: 'Lucky@2018'
// }
//});
//var mailOptions = {
// from: 'youremail@gmail.com',
// to: 'myfriend@yahoo.com',
//subject: 'Sending Email using Node.js',
//text: 'That was easy!'
//};
//transporter.sendMail(mailOptions, function(error, info){
//if (error) {
//console.log(error);
//} else {
//console.log('Email sent: ' + info.response);
//}
//});
//var crypto = require('crypto');
//var name = 'braitsch';
//var hash = crypto.createHash('md5').update(name).digest('hex');
//console.log(hash); // 9b74c9897bac770ffc029102a200c5de