12345678910111213141516171819202122232425262728293031323334353637383940 |
- var pgConfig = {
- isOpen: false, // 是否启用本数据库
- poolConfig: null
- };
- //开发环境
- const devPoolconfig = {
- user: "postgres",
- host: '172.31.16.32',
- database: "xz0809",
- password: "123456",
- port: 5432,
- max: 20,
- idleTimeoutMillis: 3000
- }
- //生产环境
- const proPoolConfig = {
- user: "postgres",
- host: '172.31.16.32',
- database: "xz0809",
- password: "123456",
- port: 5432,
- max: 20,
- idleTimeoutMillis: 3000
- }
- switch (process.env.NODE_ENV) {
- case "development":
- pgConfig.poolConfig = devPoolconfig
- break;
- case "production":
- pgConfig.poolConfig = proPoolConfig
- break;
- default:
- break;
- }
- module.exports = pgConfig;
|