-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
33 lines (28 loc) · 950 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
const path = require('path');
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('public'));
app.use(session({
secret: 'pookey',
resave: false,
saveUninitialized: true,
cookie: { secure: false }
}));
app.use(cors());
app.use(express.static('./javascript'));
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;