-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
47 lines (40 loc) · 903 Bytes
/
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
39
40
41
42
43
44
45
46
47
const Sequelize = require('Sequelize');
const OPTS = {
max: 10,
min: 0,
idle: 10000
}
const testConfig = {
dialect: 'mysql',
host: 'localhost',
port: 3600,
database: 'test',
username: 'test', // 你自己的mysql用户名
password: '123456789', // 用户名密码
opt: OPTS
};
const devConfig = {
dialect: 'mysql',
host: 'localhost',
port: 3600,
database: 'hospitalbackup',
username: 'test',
password: '123456789',
opt: OPTS
};
const proConfig = {
dialect: 'mysql',
host: 'localhost',
port: 3600,
database: 'hospital',
username: 'test',
password: '123456789',
opt: OPTS
};
const CONFIG = process.env.NODE_ENV === 'production' ? proConfig : devConfig;
const sequelize = new Sequelize(CONFIG.database, CONFIG.username, CONFIG.password, {
host: CONFIG.host,
dialect: CONFIG.dialect,
pool: CONFIG.opt
})
module.exports = { sequelize, Sequelize }