-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
36 lines (31 loc) · 1.02 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
const path = require('path');
const { access_router } = require('./routes/accessRouter');
const { admin_router } = require('./routes/adminRoutes');
const { clinic_router } = require('./routes/clinicRoutes');
const {express, router} = require('./routes/patientRoutes');
const session = require('express-session');
const cors = require('cors');
const app = express();
const port = 3000;
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(express.static('vendor'));
app.use(express.static('public'));
app.use(express.static('uploads'));
app.use(session({
secret: 'pookey',
resave: false,
saveUninitialized: true,
cookie: { secure: false }
}));
app.use(cors());
app.use('/access', access_router);
app.use('/patient', router);
app.use('/clinic', clinic_router);
app.use('/admin', admin_router);
app.listen(port, () => {
console.log(`Server is running on http://localhost:${port}`);
});
module.exports = app;