-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (29 loc) · 1.38 KB
/
index.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
var mongoose = require('mongoose');
var db = mongoose.connection;
mongoose.connect('mongodb://localhost/test/');
var queryService = require('./queryServer.js');
var interfaces = require('./interfaces.js');
// Demo code
// This will be replaced with full scale modelTables for production
var modelTable = {};
modelTable.attendance = mongoose.model('Attendance',
(new mongoose.Schema({
deviceType: String,
deviceID: Number,
version: Number,
cardID: String,
unixTimestamp: Number,
humanTimestamp: String,
})));
modelTable.student = mongoose.model('Student',
(new mongoose.Schema({
name : {
first : String,
last : String,
},
cardID : String,
})));
dbHandle = {}; // Placeholder for DBWriter service
interfaces.configure(modelTable, dbHandle, queryService);
interfaces.startUDPInterface(8080);
interfaces.startHTTPInterface(8081);