-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
64 lines (49 loc) · 1.47 KB
/
script.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
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();
});
// create user + contact(s)
app.post('/', function(req, res){
// res.sendStatus(200);
// var data = req.body;
console.log("CREATE USER");
// res.send("fasbhdjnlk");
// var name = req.body.name;
// var email = req.body.email;
// var password = req.body.password;
console.log("-----------REQ:\n"+req.body);
console.log("-----------");
res.end();
});
app.post('/api/createEmergencyContact', function(req, res){
var data = req.body;
var name = req.body.name;
var phoneNum = req.body.phoneNum;
var profileID = req.body.profileID;
});
app.post('/api/modifyContactInfo', function(req, res){
var data = req.body;
var contactID = req.body.contactID;
var name = req.body.name;
var phoneNum = req.body.phoneNum;
var profileID = req.body.profileID;
});
app.post('/api/deleteContact', function(req, res){
var data = req.body;
var contactID = req.body.contactID;
});
app.post('/api/getContacts', function(req, res){
var data = req.body;
var profileID = req.body.profileID;
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});