-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (26 loc) · 918 Bytes
/
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
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const Cors = require('cors');
const PatientRoute = require('./Route/patient.route');
const AdmissionRoute = require('./Route/admission.route');
const TreatmentRoute = require('./Route/treatment.route');
const InjectionRoute = require('./Route/injection.route');
const QuestionnaireRoute = require('./Route/questionnaire.route');
const app = express();
app.use('/patient', PatientRoute);
app.use('/admission', AdmissionRoute);
app.use('/treatment', TreatmentRoute);
app.use('/injection', InjectionRoute);
app.use('/questionnaire', QuestionnaireRoute);
app.use(express.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());
app.use(Cors());
app.listen(3001, function (err) {
if (err) {
console.error(err);
return;
}
console.log('Listening on port 3000');
});