-
Notifications
You must be signed in to change notification settings - Fork 2
/
loader.js
55 lines (48 loc) · 1.32 KB
/
loader.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
require('dotenv').config();
const exp = require("express");
const bodyParser= require("body-parser");
const cookieParser = require('cookie-parser');
const session = require('express-session');
const patientsRoutes = require("./routes/routeInfo");
const validate = require("./middleware/validate")
const app = exp();
app.use(bodyParser.urlencoded({extended : true}));
app.set('view engine', 'ejs');
app.use(exp.static('public'));
app.use(cookieParser());
app.use(session({
secret: process.env.DB_SECRET_KEY,
resave: false,
saveUninitialized: true,
cookie : {
maxAge : 600000,
}
}));
app.use(patientsRoutes);
// async function connect()
// {
// try
// {
// // connecting to the db
// const sequelize = dbUtils.sequelize;
// await sequelize.authenticate()
// console.log('connected to the db successfully');
// }
// catch(error)
// {
// console.error('Unable to connect to the database: ', error);
// }
// try
// {
// // connecting to the redis server
// const client = redisService.client;
// await client.connect();
// console.log("connected to the redis successfully");
// }
// catch(error)
// {
// console.log("connection issue in redis : ", error);
// }
// }
// connect();
module.exports = {app}