-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
80 lines (60 loc) · 2.81 KB
/
app.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
72
73
74
75
76
77
78
79
80
//var urlDataBase = 'postgres://ivlmhkficuzslb:WMu8cz613zO4s9lVcDJuHkFeoS@ec2-54-163-230-103.compute-1.amazonaws.com:5432/d361hsb4scaqro';
//var urlDataBase="postgres://postgres:1@localhost:5433/InnoHospital";
var express = require('express');
var cons = require('consolidate');
var dust = require('dustjs-helpers');
var config = require('./config');
var http = require('http');
var path = require('path');
var log = require('./libs/log')(module);
var app = express();
app.engine('dust',cons.dust);
// all environments
app.set('port', config.get('port'));
app.set('view engine','dust');
app.set('views',__dirname+'/views');
app.use(express.static(path.join(__dirname,'public')));
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({
secret: 'SOME',
cookie: { maxAge: null }
}));
app.use(app.router);
app.use(function(err, req, res, next){
if(app.get('env') == 'development'){
var errorHandler = express.errorHandler();
errorHandler(err, req, res, next);
} else {
res.send(500);
}
});
app.get('/', require('./routes/index').index);
app.post('/SendMail', require('./routes/mymailer').SendNotification);
// Patient handlers
app.get('/patient', require('./routes/patient').patient);
app.get('/patient_cabinet', require('./routes/patient').get_patient_cabinet);
app.post('/patient_cabinet', require('./routes/patient').post_patient_cabinet);
app.post('/addPatient', require('./routes/patient').addPatient);
app.get('/registration', require('./routes/patient').registration);
app.post('/newAppointment', require('./routes/patient').newAppointment);
app.get('/PatientCard', require('./routes/patient').medCard);
app.get('/Scans', require('./routes/patient').scans);
app.get('/analysis', require('./routes/patient').analysis);
app.post('/submit_feedback', require('./routes/patient').submit_feedback);
//Staff handlers
app.get('/gotoprofile', require('./routes/staff').staffInfo);
app.post('/signinStaff', require('./routes/staff').signinStaff);
app.get('/staff', require('./routes/staff').staff);
app.post('/appointmentBtt', require('./routes/staff').Input_information_for_patient);
app.get('/backToStaffMain', require('./routes/staff').StaffMain);
app.post('/submitAD', require('./routes/staff').submitAD);
app.post('/submitLabResult', require('./routes/staff').submitLabResult);
app.post('/submitScans', require('./routes/staff').submitScans);
app.post('/declineAppointment', require('./routes/staff').declineAppointment);
app.post('/newAppointmentFromDoctor', require('./routes/staff').newAppointment);
app.post('/sendingScan', require('./routes/scansHandler').sendingScan);
http.createServer(app).listen(config.get('port'), function(){
console.log('Express server listening on port ' + config.get('port'));
});