-
Notifications
You must be signed in to change notification settings - Fork 2
/
sequelize.config.js
38 lines (36 loc) · 1 KB
/
sequelize.config.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
const path = require('path');
require('dotenv').config(); // Load environment variables from .env file
module.exports = {
// development: {
// username: process.env.DB_USERNAME,
// password: process.env.DB_PASSWORD,
// database: process.env.DB_NAME,
// host: process.env.DB_HOST,
// dialect: 'postgres',
// dialectOptions: {
// ssl: process.env.DATABASE_SSL === 'true',
// },
// },
development: {
url: process.env.DATABASE_URL,
password: process.env.DB_PASSWORD,
dialect: 'postgres',
dialectOptions: {
ssl: {
require: true, // This will force SSL connection
rejectUnauthorized: false, // This allows self-signed certificates
},
},
},
production: {
url: process.env.DATABASE_URL,
password: process.env.DB_PASSWORD,
dialect: 'postgres',
dialectOptions: {
ssl: {
require: true, // This will force SSL connection
rejectUnauthorized: false, // This allows self-signed certificates
},
},
}
}