-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript22.js
71 lines (51 loc) · 1.72 KB
/
script22.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
var express = require('express');
var app = express();
// var sql = require('mssql');
var bodyParser = require('body-parser');
app.use(bodyParser.json()); // to support JSON-encoded bodies
app.use(bodyParser.urlencoded({ // to support URL-encoded bodies
extended: true
}));
app.get('/', function (req, res) {
res.send("osdfiuyguashbjknljdfiuydghjsbcnxklsajdfiudghj");
res.end();
console.log("get");
console.log(req);
});
// create user + contact(s)
app.post('/', function(req, res){
console.log("post");
console.log(req.body)
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
// sql.connect("mssql://lifeline:[email protected]/lifeline?encrypt=true").then(function() {
// // Query
// new sql.Request().query('INSERT INTO Emergency_Contact_Info(Name, Email, Password) values (name, email, password').then(function(recordset) {
// console.dir(recordset);
// })
// .catch(function(err) {
// console.log("catch 2\n" + err);
// // ... query error checks
// });
// // Stored Procedure
// }).catch(function(err) {
// console.log("catch \n" + err);
// // ... connect error checks
// });
// sql.connect("mssql://lifeline:[email protected]/lifeline?encrypt=true").then(function() {
// // Query
// new sql.Request().query('SELECT * FROM Emergency_Contact_Info ').then(function(recordset) {
// console.dir(recordset);
// res.send("HELLO<br/><br/>" + recordset);
// })
// .catch(function(err) {
// console.log("catch 2\n" + err);
// // ... query error checks
// });
// // Stored Procedure
// }).catch(function(err) {
// console.log("catch \n" + err);
// // ... connect error checks
// });