-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathknexfile.js
34 lines (34 loc) · 862 Bytes
/
knexfile.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
const express = require('express')
const ENVIROMENT = express().get('env')
const config = require('./config.json')[ENVIROMENT]
if (ENVIROMENT !== 'production') {
module.exports = {
client: config.client,
connection: {
database: config.database,
user: config.user,
password: config.password,
host: config.host,
port: config.port,
},
pool: {
min: 2,
max: 10
},
};
} else {
module.exports = {
client: config.client,
connection: {
socketPath: `/cloudsql/${config.socketPath}`,
database: config.database,
user: config.user,
password: config.password,
port: config.port
},
pool: {
min: 1,
max: 10
},
};
}