79 lines
2.2 KiB
JavaScript
79 lines
2.2 KiB
JavaScript
|
|
|
|
|
|
const config = {
|
|
|
|
development: {
|
|
database: {
|
|
host: process.env.DB_HOST,
|
|
user: process.env.DB_USER ,
|
|
password: process.env.DB_PASSWORD ,
|
|
database: process.env.DB_NAME,
|
|
waitForConnections: true,
|
|
connectionLimit: 10,
|
|
queueLimit: 0,
|
|
enableKeepAlive: true,
|
|
keepAliveInitialDelay: 0,
|
|
namedPlaceholders: true,
|
|
connectTimeout: 10000,
|
|
idleTimeout: 60000,
|
|
maxIdle: 10
|
|
},
|
|
server: {
|
|
port: process.env.PORT,
|
|
cors: {
|
|
origin: [
|
|
'http://localhost:5173',
|
|
'http://localhost:5174',
|
|
'http://localhost:3000',
|
|
'http://localhost:8081',
|
|
'http://testhospital.localhost:5174',
|
|
'http://testhospitaltwo.localhost:5174',
|
|
]
|
|
}
|
|
},
|
|
websocket: {
|
|
port: 40510,
|
|
perMessageDeflate: false
|
|
}
|
|
},
|
|
production: {
|
|
database: {
|
|
host: process.env.DB_HOST,
|
|
user: process.env.DB_USER,
|
|
password: process.env.DB_PASSWORD,
|
|
database: process.env.DB_NAME,
|
|
waitForConnections: true,
|
|
connectionLimit: 20,
|
|
queueLimit: 0,
|
|
enableKeepAlive: true,
|
|
keepAliveInitialDelay: 0,
|
|
namedPlaceholders: true,
|
|
connectTimeout: 10000,
|
|
idleTimeout: 60000,
|
|
maxIdle: 20
|
|
},
|
|
server: {
|
|
port: process.env.PORT || 3000,
|
|
cors: {
|
|
origin: [
|
|
'https://spurrinai.com',
|
|
'https://www.spurrinai.com',
|
|
'https://spurrinai.info',
|
|
'https://www.spurrinai.info',
|
|
'http://www.spurrinai.info',
|
|
'https://spurrinai.org',
|
|
'https://www.spurrinai.org'
|
|
]
|
|
}
|
|
},
|
|
websocket: {
|
|
port: 40510,
|
|
perMessageDeflate: false
|
|
}
|
|
|
|
|
|
}
|
|
};
|
|
|
|
module.exports = config[process.env.NODE_ENV || 'development'];
|